This document explains the cache busting system implemented to resolve aggressive browser caching issues.
The website was experiencing strong caching issues, particularly in Brave browser, where users were seeing older versions of the site even after updates were deployed.
We implemented a multi-layered cache busting system:
All CSS and JavaScript files now use dynamic version parameters based on Jekyll’s build time:
<!-- Before -->
<link rel="stylesheet" href="/css/main.css?v=20250904t">
<script src="/js/app.js?v=20250904c"></script>
<!-- After -->
<link rel="stylesheet" href="/css/main.css?v=20250916032840">
<script src="/js/app.js?v=20250916032840">
Updated _headers
file to use more reasonable cache durations:
Added js/cache-buster.js
that:
Added meta tag to track cache version:
<meta name="cache-version" content="20250916032840">
Created utility scripts for managing cache versions:
scripts/update-cache-version.js
- Updates cache version manuallyscripts/deploy-with-cache-bust.js
- Deployment with automatic cache bustingEvery time the site is built/deployed, cache versions are automatically updated using Jekyll’s site.time
variable.
If you need to force a cache update:
# Update cache version
node scripts/update-cache-version.js
# Or deploy with cache busting
node scripts/deploy-with-cache-bust.js --commit
Users will automatically see a notification when their cached version is outdated. They can:
CRITICAL: The cache busting system is designed to preserve all user data:
anchored_notes_*
, anchored_sync_queue
, anchored_last_sync
, anchored_change_count
, anchored_meta
supabase_session
, userTier
, profileLastChecked
, subscriptionLastChecked
cachedSubscription
, subscriptionCacheTime
encryptionKeyLastChecked
, cachedKeyMaterial
, cachedSalt
theme
, upgradeBannerDismissed
anchored_debug
, anchored_errors
, anchored_health_checks
anchored-cache-version
(the only key removed during cache refresh)window.CacheBuster.testNoteStorageProtection()
can verify protection worksThe cache busting system works across all modern browsers:
Cache version information is included in:
health.json
endpointhealth.json
_headers
file is being appliedhealth.json
for cache version changeswindow.CacheBuster.testNoteStorageProtection()
in consoleTo verify that cache busting doesn’t affect note storage:
// Run in browser console
window.CacheBuster.testNoteStorageProtection()
This test will:
_layouts/default.html
- Dynamic version parameters_headers
- Reduced cache durationsjs/cache-buster.js
- Client-side detectionhealth.json
- Cache version trackingscripts/update-cache-version.js
- Manual cache bustingscripts/deploy-with-cache-bust.js
- Deployment helper