Advertisement
kobial8

Enable Compression & Cache

Apr 21st, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PUT THE FOLLOWING CODES IN .htaccess code:
  2.  
  3.  
  4. #GZip compression
  5. <IfModule mod_deflate.c>
  6. AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript
  7. BrowserMatch ^Mozilla/4 gzip-only-text/html
  8. BrowserMatch ^Mozilla/4\.0[678] no-gzip
  9. BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  10. </IfModule>
  11. ## EXPIRES CACHING ##
  12. <IfModule mod_expires.c>
  13. ExpiresActive On
  14. ExpiresByType image/jpg "access plus 1 year"
  15. ExpiresByType image/jpeg "access plus 1 year"
  16. ExpiresByType image/gif "access plus 1 year"
  17. ExpiresByType image/png "access plus 1 year"
  18. ExpiresByType text/css "access plus 1 month"
  19. ExpiresByType application/pdf "access plus 1 month"
  20. ExpiresByType text/x-javascript "access plus 1 month"
  21. ExpiresByType application/x-shockwave-flash "access plus 1 month"
  22. ExpiresByType image/x-icon "access plus 1 year"
  23. ExpiresDefault "access plus 2 days"
  24. </IfModule>
  25. ## EXPIRES CACHING ##
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement