Header unset Pragma FileETag None Header unset ETag # cache images/pdf docs for 10 days <FilesMatch "\.(ico|pdf|jpg|jpeg|png|gif)$"> Header set Cache-Control "max-age=864000, public, must-revalidate" Header unset Last-Modified </FilesMatch> # cache html/htm/xml/txt diles for 2 days <FilesMatch "\.(html|htm|xml|txt|xsl)$"> Header set Cache-Control "max-age=7200, must-revalidate" </FilesMatch>
In this tutorial you will find out how to speed up your site with only some minor changes to your .htaccess file
Enable file caching
Enable caching of files on the client-side (inside the browser).
For more details, see How to enable file caching with .htaccess in Apache
Compress JavaScript and style-sheet files
<IfModule mod_deflate.c> <FilesMatch "\.(js|css)$"> SetOutputFilter DEFLATE </FilesMatch> </IfModule>