PDA

View Full Version : Leverage Browser Caching


popular
10-14-2011, 08:20 PM
I tried setting all images gif/jpeg/png/ico images to cache for 2 yrs by putting this in my .htaccess root folder

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
## EXPIRES CACHING ##

The above worked but I also noticed weird bugs that came with it as well, for example when I made a new post or thread i would not be able to see the post or thread until I clicked the refresh button a couple of times, and I also had trouble logging in and out of the forum, I would get this pop up error message Your submission could not be processed because you have logged in since the previous page was loaded. <br/>

Can anyone tell me why it's doing this? What am i doing wrong? :confused:

kh99
10-15-2011, 09:58 AM
I'm not familiar with that module and this is only a guess, but maybe try taking out the ExpiresDefault line? (and then I suppose you may need to clear your cache before testing it).

Mark_Zuckerberg
09-30-2012, 08:42 PM
try this link

https://vborg.vbsupport.ru/showthread.php?t=267588
it works for me too good