Guides‎ > ‎

Server optimizations

Get more speed from your server


Note: All these tips sound unnecessary with W3 total cache

Speed optimizations
  • Turn On Compression
  • Add Future Expires Header
  • Add Cache-Control Headers
  • Turn Off ETags
  • Remove Last-Modified Header

Add to your .htaccess file

#           HEADERS and CACHING
# 1 YEAR
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Pragma
Header unset Last-Modified
Header unset ETag
FileETag None
</FilesMatch>
 
# 2 DAYS
<FilesMatch "\.(xml|txt)$">
Header set Cache-Control "max-age=172800, public, must-revalidate"
Header unset Pragma
Header unset Last-Modified
Header unset ETag
FileETag None
</FilesMatch>
 
# 2 HOURS
<FilesMatch "\.(html|htm)$">
Header set Cache-Control "max-age=7200, must-revalidate"
Header unset Pragma
Header unset ETag
FileETag None
</FilesMatch>
 
# COMPRESSION
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>

Comments