Caching
Caching in Thulite has two layers:
- Build-time cache (Hugo resource and data caches)
- Runtime cache (browser and CDN caching for generated assets)
Configure Hugo build caches
Set cache directories in your Hugo config so repeated builds are faster and deterministic:
[caches]
[caches.getresource]
dir = ":cacheDir/:project"
maxAge = -1For projects using Thulite Core, you can also configure getjson, getcsv, images, and assets caches.
Use fingerprinted assets for long-lived caching
Thulite Core fingerprints CSS and JavaScript bundles. Because filenames change when content changes, you can safely cache those files aggressively.
Recommended strategy:
- HTML: short cache lifetime or revalidate often
- Fingerprinted CSS/JS/fonts/images: long cache lifetime (for example
max-age=31536000, immutable)
Add cache headers at the edge
Set cache headers in your host or CDN config (for example Netlify). Keep document caching conservative and static fingerprinted assets aggressive.
Verify caching behavior
After npm run build, check public/ for fingerprinted assets and validate headers in browser dev tools:
- HTML responses are revalidated as expected
- Fingerprinted assets return long-lived cache headers
- A new build changes asset filenames when content changes
Learn more
Configure file caches
Hugo configuration reference for resource and data cache settings.
resources.Fingerprint
Generate content-hashed asset filenames for immutable caching.
Cache-Control header
MDN reference for cache directives used by browsers and CDNs.