Browser Caching in WordPress: Cache-Control, Assets and Repeat Visits
Learn what browser caching does, how it differs from page caching, and why asset versioning matters.
Short answer: Browser caching lets a visitor’s browser reuse previously downloaded assets when cache headers and resource URLs allow it. It is distinct from server-side page caching: one reduces repeated downloads, the other reduces repeated page generation.
CSS, JavaScript, fonts and images often benefit from longer browser lifetimes when their URLs change on update.
Static asset caching
CSS, JavaScript, fonts and images often benefit from longer browser lifetimes when their URLs change on update.
HTML generally needs more conservative caching because content changes more frequently.
- Change one important variable at a time.
- Compare repeatable behavior rather than one isolated score.
- Keep reliability and maintainability ahead of marginal benchmark gains.
Cache-Control concepts
HTML generally needs more conservative caching because content changes more frequently.
When debugging, distinguish a browser-cached file from a server/CDN-cached HTML response.
- Identify which layer is caching the response.
- Prefer the narrowest safe purge instead of clearing every cache by default.
- Verify behavior while logged out or in a private browsing session when testing public page caching.
Versioned filenames
When debugging, distinguish a browser-cached file from a server/CDN-cached HTML response.
CSS, JavaScript, fonts and images often benefit from longer browser lifetimes when their URLs change on update.
- Change one important variable at a time.
- Compare repeatable behavior rather than one isolated score.
- Keep reliability and maintainability ahead of marginal benchmark gains.
HTML versus long-lived assets
CSS, JavaScript, fonts and images often benefit from longer browser lifetimes when their URLs change on update.
HTML generally needs more conservative caching because content changes more frequently.
- Change one important variable at a time.
- Compare repeatable behavior rather than one isolated score.
- Keep reliability and maintainability ahead of marginal benchmark gains.
CDN interaction
HTML generally needs more conservative caching because content changes more frequently.
When debugging, distinguish a browser-cached file from a server/CDN-cached HTML response.
- Change one important variable at a time.
- Compare repeatable behavior rather than one isolated score.
- Keep reliability and maintainability ahead of marginal benchmark gains.
Practical decision rule
Fix the layer the evidence points to. Caching helps repeated server work; CSS and JavaScript work affect rendering and responsiveness; images and fonts affect transfer and discovery; hosting and application behavior affect origin response. Avoid solving a different problem just because a tool is popular.
Related guides
Sources and further reading
Editorial note: Product features, pricing and plan terms can change. Commercial claims are checked against current vendor documentation where cited; verify the live merchant page before purchase.