You can disable the cache by adding the following to the .htaccess

<Files index.php>

FileETag None Header unset ETag Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"

</Files>  

Alternatively, to target certain selected files, ie. to cache images but nothing else (files that match HTML, htm, js, CSS, PHP will not be cached):

Use the following code within the .htaccess

<filesMatch "\.(html|htm|js|css|php)$">

FileETag None

Header unset ETag

Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"

Header set Pragma "no-cache"

Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"

<filesMatch>

 

Cette réponse était-elle pertinente? 0 Utilisateurs l'ont trouvée utile (0 Votes)