Quick .htaccess snippet to disable browser caching by modifying 
Cache-Control, Pragma, and Expires headers. Strictly plug-n-play.
Just add the following directives to your site’s root .htaccess file:
Update #2: Here is another technique for caching static resources while optimizing performance:
Just add the following directives to your site’s root .htaccess file:
Apache
# DISABLE CACHING
<IfModule mod_headers.c>
 Header set Cache-Control "no-cache, no-store, must-revalidate"
 Header set Pragma "no-cache"
 Header set Expires 0
</IfModule>
 Updates
Update #1: Here is another line that you can play with:Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"Update #2: Here is another technique for caching static resources while optimizing performance:
Apache
 
<FilesMatch "\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|png|pdf|swf|txt)$">
 <IfModule mod_expires.c>
  ExpiresActive Off
 </IfModule>
 <IfModule mod_headers.c>
  FileETag None
  Header unset ETag
  Header unset Pragma
  Header unset Cache-Control
  Header unset Last-Modified
  Header set Pragma "no-cache"
  Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
  Header set Expires "Mon, 10 Apr 1972 00:00:00 GMT"
 </IfModule>
</FilesMatch>
  
 
 
 
 
 
 
 
0 Comments