Advertisement
Jerkiller

htaccess

May 18th, 2015
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.28 KB | None | 0 0
  1. # Questo qui Γ¨ il codice che permette di effettuare il caching del sito:
  2.  
  3. ## EXPIRES CACHING ##
  4. <IfModule mod_expires.c>
  5.         ExpiresActive On
  6.         # Default
  7.         ExpiresDefault "access plus 1 month"
  8.         # My favicon
  9.         ExpiresByType image/x-icon "access plus 1 year"
  10.         # Images
  11.         ExpiresByType image/gif "access plus 1 month"
  12.         ExpiresByType image/png "access plus 1 month"
  13.         ExpiresByType image/jpg "access plus 1 month"
  14.         ExpiresByType image/jpeg "access plus 1 month"
  15.         # CSS
  16.         ExpiresByType text/css "access plus 1 month"
  17.         # Javascript
  18.         ExpiresByType application/javascript "access plus 1 year"
  19.         ExpiresByType text/x-javascript "access plus 1 year"
  20.         # Documents
  21.         ExpiresByType text/html "access 1 month"
  22.         ExpiresByType application/pdf "access 1 month"
  23. </IfModule>
  24.  
  25.  
  26. # Questo invece Γ¨ il codice che comprime i file
  27.  
  28. <ifModule mod_gzip.c>
  29. mod_gzip_on Yes
  30. mod_gzip_dechunk Yes
  31. mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
  32. mod_gzip_item_include handler ^cgi-script$
  33. mod_gzip_item_include mime ^text/.*
  34. mod_gzip_item_include mime ^application/x-javascript.*
  35. mod_gzip_item_exclude mime ^image/.*
  36. mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  37. </ifModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement