You can make all the necessary changes inside HTML files, for example
<meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0" /> <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" /> <meta http-equiv="pragma" content="no-cache" />
But also you can directly tell Apache to use the mod_expires.c module and add a couple of directives to the httpd.conf file:
<IfModule mod_expires.c> # Turn on the module. ExpiresActive on # Set the default expiry times. ExpiresByType text/html "modification plus 5 seconds" ExpiresByType text/javascript "modification plus 5 seconds" ExpiresDefault "access plus 2 days" </IfModule>
Thus, you add cache control of HTTP headers and end them before replies so that the browser updates the cache 5 seconds after the file was changed at the beginning, for these files, and 2 days after accessing the browser for all other types files.
Hope this helps.
Camilo Apr 18 '18 at 15:53 2018-04-18 15:53
source share