Focus Pages — PWA Stale Content Fix
Section titled “Focus Pages — PWA Stale Content Fix”Date: 2026-06-20
Repos: ~/projects/monorepo, ~/utils/web/web-deploy
Task: Core/_WorkingOn/Tasks/Focus-pages-stale.md
Problem
Section titled “Problem”MBR (and SDC) focus page PWAs showed stale content when returned to after using another app. First open and immediate re-open were fine; the issue appeared only after Android backgrounded and then evicted the PWA tab from memory.
Root cause: No Cache-Control header on focus.html. Browsers use heuristic caching
when no header is set (typically hours, based on Last-Modified). On resume, Chrome
restored the page from HTTP cache rather than re-fetching.
What Changed
Section titled “What Changed”Cloudflare Pages — _headers (both sites)
Section titled “Cloudflare Pages — _headers (both sites)”Added to sites/mbr/public/_headers and sites/sdc/public/_headers (after the /* block):
/focus.html Cache-Control: no-cache, must-revalidateFTP host (talbotstevens.com) — .htaccess
Section titled “FTP host (talbotstevens.com) — .htaccess”Created sites/mbr/public/.htaccess and sites/sdc/public/.htaccess:
<IfModule mod_headers.c> <Files "focus.html"> Header set Cache-Control "no-cache, must-revalidate" </Files></IfModule>Astro copies public/ to dist/ at build time — .htaccess lands in dist/ automatically.
Deploy scripts — upload .htaccess
Section titled “Deploy scripts — upload .htaccess”Added .htaccess to FAVICON_FILES in both:
sdc-mission-deploy/deploy_mbr_focus.pysdc-mission-deploy/deploy_sdc_focus.py
Why no-cache, must-revalidate
Section titled “Why no-cache, must-revalidate”no-cache= always send a conditional GET before serving from cache- If server returns 304 (unchanged): serve cache instantly — fast
- If server returns 200 (changed): use new content — fresh
must-revalidate= never serve stale content if the server is reachable- NOT
no-store— that would prevent any caching, breaking offline access
Log location going forward
Section titled “Log location going forward”Monorepo change logs belong at:
Core/Logs/Projects/monorepo/YYYY-MM-DD_<topic>.md(this file)- In-repo:
CHANGELOG.md+LESSONS.md(already established per June 15 session)
Previous focus page work was logged at Core/Logs/Dev/2026-05-26_Focus-Reminders.md
(task file) and Core/Logs/Dev/2026-05-31_Focus-Page-Favicons.md. Those were pre-June-15
structure. Use Core/Logs/Projects/monorepo/ going forward.
Deployment
Section titled “Deployment”Run web-deploy → mbr-focus → online and sdc-focus → online to push the
.htaccess files alongside the rebuilt HTML.
After deployment, the PWA will always revalidate focus.html on open. No reinstall
required — the next open will get the header-controlled response.