[object Object]

← back to Wallco Ai

wallco.ai · /brief?ids= now ships Cache-Control + Last-Modified · populated brief: public,max-age=3600 (1h — shorter than tearsheet because designers may rotate project/client labels per session) + LM=max(created_at) over the selected designs; empty landing page: public,max-age=600 (10m) · verified: populated → 200 + headers + LM Tue 12 May 2026 05:11:59 GMT; IMS-match → 304 0B; empty → 200 + 10m cache

702842cadb1aa9543801ac16600928fc74f9d30a · 2026-05-12 09:03:58 -0700 · SteveStudio2

Files touched

Diff

commit 702842cadb1aa9543801ac16600928fc74f9d30a
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Tue May 12 09:03:58 2026 -0700

    wallco.ai · /brief?ids= now ships Cache-Control + Last-Modified · populated brief: public,max-age=3600 (1h — shorter than tearsheet because designers may rotate project/client labels per session) + LM=max(created_at) over the selected designs; empty landing page: public,max-age=600 (10m) · verified: populated → 200 + headers + LM Tue 12 May 2026 05:11:59 GMT; IMS-match → 304 0B; empty → 200 + 10m cache
---
 server.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/server.js b/server.js
index 7880433..1d04242 100644
--- a/server.js
+++ b/server.js
@@ -5491,6 +5491,7 @@ app.get('/brief', (req, res) => {
   const clientName = String(req.query.client || '').slice(0, 80);
   const esc = (s) => String(s||'').replace(/[<>&"]/g, c => ({'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c]));
   if (!designs.length) {
+    res.setHeader('Cache-Control', 'public, max-age=600, must-revalidate'); // landing page — short cache
     return res.type('html').send(`<!doctype html><html><head><meta charset="utf-8"><title>Brief — wallco.ai</title>
 <style>body{font:14px/1.5 -apple-system,system-ui,sans-serif;max-width:600px;margin:60px auto;padding:24px;color:#333}a{color:#111}</style></head><body>
 <h1 style="font:300 32px/1.1 Georgia,serif">Build a design brief</h1>
@@ -5500,6 +5501,14 @@ app.get('/brief', (req, res) => {
 <p>Alternatively, start a <a href="/compare">/compare</a>, then export the comparison as a brief.</p>
 </body></html>`);
   }
+  // Cache the populated brief — query string (ids + project + client) is part of the cache key.
+  // max-age=3600 (1h) — shorter than tearsheet (24h) because designers may rotate project/client labels.
+  const briefLM = designs.reduce((acc, d) => {
+    const t = d.created_at ? new Date(d.created_at) : null;
+    return t && (!acc || t > acc) ? t : acc;
+  }, null) || new Date();
+  if (maybe304(req, res, briefLM)) return;
+  res.setHeader('Cache-Control', 'public, max-age=3600, must-revalidate');
   const today = new Date().toISOString().slice(0, 10);
   const tearsheet = (d) => {
     const roomKey = (d.room_mockups || []).includes('living_room') ? 'living_room'

← 59a2afc wallco.ai · /design/:id/tearsheet now sends Cache-Control:pu  ·  back to Wallco Ai  ·  wallco.ai · /compare gets 'Export as Brief →' gold button + cdb0765 →