Skip to content

add HTTP "Cache-Control: immutable" headers for CSS+JS

Added HTTP "Cache-Control: immutable" headers for CSS and JS files to use the browser's cache to the maximum.

  • For Firefox, thhe HTTP "Cache-Control: immutable" header will be honored only if the content is served in HTTPS.
  • Chrome does not actually support immutable at the moment, but has its own new heuristics

Documentation:

<IfModule mod_headers.c>
    <FilesMatch "\.(js|css)$">
        Header set Cache-Control "public, max-age=31536000, immutable"
    </FilesMatch>
</IfModule>
Edited by Fabrice Gangler