Section 21 · Infrastructure Features
Caching
Static asset caching via CDN and content hash-based cache invalidation
2 items 2 recommended
This guide walks you through auditing a project's static asset caching configuration, including CDN caching and content hash-based cache invalidation.
The Goal: Cache Everything, Invalidate Reliably
A well-configured caching strategy delivers fast page loads while ensuring users always see the latest content when you ship changes.
- CDN-served — Static assets (JS, CSS, images, fonts) come from edge locations with appropriate cache headers
- Hash-based invalidation — Content hashes in filenames ensure reliable cache busting when code changes
- Long TTLs for immutable assets — Hashed assets get aggressive caching (1 year) since the hash handles versioning
- No cache misconfigurations — Every asset has intentional cache settings, not defaults or no-cache
Before You Start
- Get the production URL from the user
- Identify the CDN provider (Cloudflare, Fastly, CloudFront, Vercel, etc.)
- Identify the build tool (Vite, Webpack, Next.js, etc.)
Static Asset Caching
CACHE-001
Static assets cached by CDN recommended
JS, CSS, images, and fonts served through CDN with appropriate Cache-Control headers
“Are users downloading your JS bundle from your origin server?”
CACHE-002
Content hashes for cache invalidation recommended
Asset filenames include content hashes enabling long TTLs with automatic invalidation on changes
“Do users need to hard-refresh to get your latest deploy?”