How to cache using .htaccess trick

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to cache using .htaccess trick

    ok , is not a trick

    Code:
    <ifModule mod_expires.c>
      ExpiresActive On
      ExpiresDefault "access plus 1 hour"
      ExpiresByType text/html "access plus 1 seconds"
      ExpiresByType image/gif "access plus 2592000 seconds"
      ExpiresByType image/jpeg "access plus 2592000 seconds"
      ExpiresByType image/png "access plus 2592000 seconds"
      ExpiresByType text/css "access plus 604800 seconds"
      ExpiresByType text/javascript "access plus 216000 seconds"
      ExpiresByType application/x-javascript "access plus 216000 seconds"
    </ifModule>
    Is good if you have a site with MANY images , thumbs etc ..
    Unamos los corazones,hoy todos somos multicolores!

    #2
    Have theese also:

    Code:
    # cache images and flash content for one month
    <FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf)$">
    Header set Cache-Control "max-age=2592000"
    </FilesMatch>
    
    # cache text, css, and javascript files for one week
    <FilesMatch ".(js|css|pdf|txt)$">
    Header set Cache-Control "max-age=604800"
    </FilesMatch>
    
    # cache html and htm files for one day
    <FilesMatch ".(html|htm)$">
    Header set Cache-Control "max-age=43200"
    </FilesMatch>
    
    # implement minimal caching during site development
    <FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|js|css|pdf|swf|html|htm|txt)$">
    Header set Cache-Control "max-age=5"
    </FilesMatch>
    
    # explicitly disable caching for scripts and other dynamic files
    <FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
    Header unset Cache-Control
    </FilesMatch>
    
    # alternate method for file caching
    ExpiresActive On
    ExpiresDefault A604800 # 1 week
    ExpiresByType image/x-icon A2419200 # 1 month
    ExpiresByType application/x-javascript A2419200 # 1 month
    ExpiresByType text/css A2419200 # 1 month
    ExpiresByType text/html A300 # 5 minutes
    
    # disable caching for scripts and other dynamic files
    <FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
    ExpiresActive Off
    </FilesMatch>
    <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

    Comment


      #3
      Originally posted by morency View Post
      ok , is not a trick

      Code:
      <ifModule mod_expires.c>
        ExpiresActive On
        ExpiresDefault "access plus 1 hour"
        ExpiresByType text/html "access plus 1 seconds"
        ExpiresByType image/gif "access plus 2592000 seconds"
        ExpiresByType image/jpeg "access plus 2592000 seconds"
        ExpiresByType image/png "access plus 2592000 seconds"
        ExpiresByType text/css "access plus 604800 seconds"
        ExpiresByType text/javascript "access plus 216000 seconds"
        ExpiresByType application/x-javascript "access plus 216000 seconds"
      </ifModule>
      Is good if you have a site with MANY images , thumbs etc ..
      Good Job Man..Thx

      Comment

      Working...
      X