Expire headers

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:

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.
 

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!
 

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?
 

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?
 
Top