1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cache question

Discussion in 'Server Configuration and Hosting' started by avalon-ua, Jul 10, 2014.

  1. avalon-ua

    avalon-ua Active Member

    My hoster uses Varnish Caching technology and told me to create mod_headers and mod_expires via it .htaccess file... Who knows how to manage with it?
     
    Last edited: Jul 10, 2014
  2. Slavik

    Slavik XenForo Moderator Staff Member

    I dont have much experience with varnish, but I guess you need something like:

    Code:
    <ifModule mod_headers.c>
      <filesMatch "\.(jpe?g|png|gif)$">
        Header set Cache-Control "public"
      </filesMatch>
      <filesMatch "\.(css)$">
        Header set Cache-Control "public"
      </filesMatch>
    </ifModule>
    
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 week"
    ExpiresByType image/jpeg "access 1 week"
    ExpiresByType image/gif "access 1 week"
    ExpiresByType image/png "access 1 week"
    ExpiresByType text/css "access 1 week"
    </IfModule>
    
     
    avalon-ua likes this.
  3. avalon-ua

    avalon-ua Active Member

    Do I need to add this to it .htaccess file?
     
  4. Slavik

    Slavik XenForo Moderator Staff Member

  5. avalon-ua

    avalon-ua Active Member

    thank you very much) I will try this
     

Share This Page