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

Expire headers

Discussion in 'Server Configuration and Hosting' started by NeoCHI, Oct 31, 2014.

  1. NeoCHI

    NeoCHI Active Member

    My host (knownhost) just added:

    Code:
    ## EXPIRES CACHING ##
    
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 2 days"
    </IfModule>
    
    ## EXPIRES CACHING ##
    
    # Enable expirations
    ExpiresActive On
    # Default directive
    ExpiresDefault "access plus 1 month"
    # My favicon
    ExpiresByType image/x-icon "access plus 1 year"
    # Images
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    
    # CSS
    ExpiresByType text/css "access 1 month"
    
    # Javascript
    ExpiresByType application/javascript "access plus 1 year"
    
    for me, but I think this is causing issues for my site. New threads and posts are loading unless the user does a hard refresh...
     
    Last edited: Oct 31, 2014
  2. NeoCHI

    NeoCHI Active Member

    I'm especially suspicious of:
    Code:
    ExpiresDefault "access plus 2 days"
    
     
  3. Xon

    Xon Well-Known Member

    That ExpiresDefault would be causing browsers to cache everything without an explicit cache statement for 2 days. That includes the forums, threads, etc.
     
  4. NeoCHI

    NeoCHI Active Member

    That's what I assumed.....I even told my technician at my hosting service that that line they added for me seems highly suspicious and he kept saying it's only for images/css. Freaking idiot! I forgive the person who added it since he may not have known my site was a forum but not the guy I specifically told him what the issue was and he still denied it....

    Knownhost support get your crap together!
     
  5. NeoCHI

    NeoCHI Active Member

    Btw, can someone show what I SHOULD use for expire headers? Also do I just need to put it into my .htaccess for it to work?
     
  6. NeoCHI

    NeoCHI Active Member

    No one? I'm assuming it's actually what my server added for me but just without the "ExpiresDefault" so:

    Code:
    ## EXPIRES CACHING ##
    
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    </IfModule>
    
    ## EXPIRES CACHING ##
    
    # Enable expirations
    ExpiresActive On
    # My favicon
    ExpiresByType image/x-icon "access plus 1 year"
    # Images
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    
    # CSS
    ExpiresByType text/css "access 1 month"
    
    # Javascript
    ExpiresByType application/javascript "access plus 1 year"
    
    Is this ok?
     

Share This Page