Guide
Browser caching basics for static websites
Caching is one of the simplest ways to make a static website feel faster. The browser can reuse files that do not change often, such as CSS, JavaScript, icons and images.
Keep HTML flexible
HTML pages usually change more often than versioned assets. A short cache time for HTML allows content updates to appear without waiting too long.
Cache assets for longer
Files inside an assets folder can usually be cached for a long time,
especially when filenames change after updates. This reduces repeated network requests.
- Use clear folder names for assets.
- Keep large scripts and stylesheets limited.
- Update filenames when content changes.