[object Object]

← back to Wallco Ai

wallco.ai · /design/:id/tearsheet now sends Cache-Control:public,max-age=86400,must-revalidate + Last-Modified (per-design created_at) + 304 via maybe304() — overrides the global no-store HTML rule because tearsheets are per-id immutable docs · designers reload these all day; saves bandwidth + speeds re-prints · verified: 200 5255B + headers Cache-Control + LM Tue 12 May 2026 03:03:47 GMT; IMS-match → 304 0B

59a2afcd96521c6f050c2f76c58e559c22dc6b07 · 2026-05-12 08:56:37 -0700 · SteveStudio2

Files touched

Diff

commit 59a2afcd96521c6f050c2f76c58e559c22dc6b07
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Tue May 12 08:56:37 2026 -0700

    wallco.ai · /design/:id/tearsheet now sends Cache-Control:public,max-age=86400,must-revalidate + Last-Modified (per-design created_at) + 304 via maybe304() — overrides the global no-store HTML rule because tearsheets are per-id immutable docs · designers reload these all day; saves bandwidth + speeds re-prints · verified: 200 5255B + headers Cache-Control + LM Tue 12 May 2026 03:03:47 GMT; IMS-match → 304 0B
---
 server.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/server.js b/server.js
index b7d53d2..7880433 100644
--- a/server.js
+++ b/server.js
@@ -5071,6 +5071,11 @@ app.get('/design/:id/tearsheet', (req, res) => {
   const created = design.created_at ? new Date(design.created_at).toISOString().slice(0,10) : '';
   const designUrl = `https://wallco.ai/design/${design.id}`;
   const esc = (s) => String(s||'').replace(/[<>&"]/g, c => ({'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c]));
+  // Per-design immutable doc — safe to cache 24h. Override the global no-store HTML rule.
+  // 304 path: ETag from design.created_at (falls back to today's date if missing).
+  const tsLM = design.created_at ? new Date(design.created_at) : new Date();
+  if (maybe304(req, res, tsLM)) return;
+  res.setHeader('Cache-Control', 'public, max-age=86400, must-revalidate');
   res.type('html').send(`<!doctype html><html lang="en"><head>
 <meta charset="utf-8"><title>${esc(design.title)} — Tear Sheet | wallco.ai</title>
 <meta name="viewport" content="width=device-width,initial-scale=1">

← 1799198 wallco.ai · 3 more pro functions inline · (1) /api/designs/b  ·  back to Wallco Ai  ·  wallco.ai · /brief?ids= now ships Cache-Control + Last-Modif 702842c →