[object Object]

← back to build-pages

static pages: Cache-Control max-age=3600 SWR=86400 on /about /privacy /terms + 1 smoke

eff2d00e4ed69b363c2979b9b8aa515388176648 · 2026-05-13 19:40:53 -0700 · SteveStudio2

Files touched

Diff

commit eff2d00e4ed69b363c2979b9b8aa515388176648
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Wed May 13 19:40:53 2026 -0700

    static pages: Cache-Control max-age=3600 SWR=86400 on /about /privacy /terms + 1 smoke
---
 server.js     | 3 +++
 test/smoke.js | 1 +
 2 files changed, 4 insertions(+)

diff --git a/server.js b/server.js
index 3245d14..4b8341e 100644
--- a/server.js
+++ b/server.js
@@ -1218,6 +1218,7 @@ app.get('/search', (req, res) => {
 
 // /privacy — what data this site collects. The honest answer: very little.
 app.get('/privacy', (_req, res) => {
+  res.setHeader('Cache-Control', 'public, max-age=3600, stale-while-revalidate=86400');
   res.send(shell('Privacy — build-pages', `
     <h1>Privacy</h1>
     <p class="bp-lede">build-pages is a static read-out of public git history. It collects nothing about you.</p>
@@ -1240,6 +1241,7 @@ app.get('/privacy', (_req, res) => {
 
 // /terms — minimal use-of-site terms.
 app.get('/terms', (_req, res) => {
+  res.setHeader('Cache-Control', 'public, max-age=3600, stale-while-revalidate=86400');
   res.send(shell('Terms — build-pages', `
     <h1>Terms of use</h1>
     <p class="bp-lede">build-pages is published as-is for transparency about how Steve's projects get built.</p>
@@ -1256,6 +1258,7 @@ app.get('/terms', (_req, res) => {
 
 // /about — short explainer for visitors arriving at projects.agentabrams.com.
 app.get('/about', (_req, res) => {
+  res.setHeader('Cache-Control', 'public, max-age=3600, stale-while-revalidate=86400');
   res.send(shell('About — build-pages', `
     <h1>About</h1>
     <p class="bp-lede">build-pages is a live build journal for every project in Steve Abrams' workshop.</p>
diff --git a/test/smoke.js b/test/smoke.js
index a6a414c..a62bc8f 100644
--- a/test/smoke.js
+++ b/test/smoke.js
@@ -165,6 +165,7 @@ function check(name, cond, hint = '') {
   r = await fetch('/terms');
   check('terms: 200',              r.status === 200);
   check('terms: as-is',            /as-is for transparency/.test(r.body));
+  check('terms: SWR cache',        /stale-while-revalidate/.test(r.headers['cache-control'] || ''));
 
   // 8. robots.txt — public crawlable + sitemap referenced
   r = await fetch('/robots.txt');

← 451c6ad alias: /search?q= 302→/?q= (convention path) + 2 smoke  ·  back to build-pages  ·  opensearch: /opensearch.xml descriptor + autodiscovery <link 89a5046 →