Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not an expert with cache controls and expire headers, but I always use this code and it always works (I'm not quite sure if that's what you are looking for but I post it anyway, see if it works for you or not) :</p> <pre><code>################# # CACHE HEADERS # ################# ## BEGIN Expire headers &lt;IfModule mod_expires.c&gt; ExpiresActive On ExpiresDefault "access plus 7200 seconds" ExpiresDefault "access plus 1 seconds" ExpiresByType image/jpg "access plus 2592000 seconds" ExpiresByType image/jpeg "access plus 2592000 seconds" ExpiresByType image/png "access plus 2592000 seconds" ExpiresByType image/gif "access plus 2592000 seconds" AddType image/x-icon .ico ExpiresByType image/ico "access plus 2592000 seconds" ExpiresByType image/icon "access plus 2592000 seconds" ExpiresByType image/x-icon "access plus 2592000 seconds" ExpiresByType text/css "access plus 2592000 seconds" ExpiresByType text/javascript "access plus 2592000 seconds" ExpiresByType text/html "access plus 7200 seconds" ExpiresByType text/html "access plus 1 seconds" ExpiresByType application/xhtml+xml "access plus 7200 seconds" ExpiresByType application/xhtml+xml "access plus 1 seconds" ExpiresByType application/javascript "access plus 2592000 seconds" ExpiresByType application/x-javascript "access plus 2592000 seconds" ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds" &lt;/IfModule&gt; ## END Expire headers ################# # CACHE CONTROL # ################# ## BEGIN Cache-Control Headers &lt;IfModule mod_headers.c&gt; &lt;FilesMatch "\\.(ico|jpe?g|png|gif|swf|gz|ttf)$"&gt; Header set Cache-Control "max-age=2592000, public" &lt;/FilesMatch&gt; &lt;FilesMatch "\\.(css)$"&gt; Header set Cache-Control "max-age=2592000, public" &lt;/FilesMatch&gt; &lt;FilesMatch "\\.(js)$"&gt; Header set Cache-Control "max-age=2592000, private" &lt;/FilesMatch&gt; &lt;filesMatch "\\.(html|htm)$"&gt; Header set Cache-Control "max-age=7200, public" Header set Cache-Control "max-age=1, public" &lt;/filesMatch&gt; # Disable caching for scripts and other dynamic files &lt;FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$"&gt; Header unset Cache-Control &lt;/FilesMatch&gt; &lt;/IfModule&gt; ## END Cache-Control Headers ######## # ETAG # ######## ## KILL THEM ETAGS Header unset ETag FileETag none </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload