Page 1 of 1

[solved] admin pages cached in browser

Posted: Mon May 04, 2015 10:10 am
by HarmO
Hello,

i've got a problem that when i work in the admin interface,
the pages get cached and i need to make sure to hard refresh my page with the keycombo (CRTL + shift + R) to see the latest version of the editor.

first time that i have a similar problem.

CMSMS version: 1.11.13

caching settings in my root htaccess:

Code: Select all

#	Cache

Header unset Pragma
FileETag None
Header unset ETag

# cache img/pdf/js files for 10 days
<FilesMatch "\.(ico|pdf|jpg|jpeg|png|gif|js|css)$">
Header set Cache-Control "max-age=864000, public, must-revalidate"
</FilesMatch>

# cache html/htm/xml/txt files for 2 days
#<FilesMatch "\.(html|htm|xml|txt|xsl)$">
Header set Cache-Control "max-age=172800, must-revalidate"
#</FilesMatch>

#	End Cache


Update:

When i add a htaccess with the following code to the admin directory it seems to resolve the problem.

Code: Select all

<FilesMatch "\.(html|htm|js|css|php)>
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</FilesMatch>

Re: admin pages cached in browser

Posted: Tue Jun 02, 2015 11:37 am
by HarmO
I made a htaccess file that disables caching and placed it in the admin folder. problem solved.

Re: [solved] admin pages cached in browser

Posted: Tue Jun 02, 2015 4:07 pm
by calguy1000
1. Yes, .htaccess rules propagate to sub directories by default.
2. IIRC (though I have not researched). The rules in the .htaccess file could override headers output by the page itself.
3. The .htaccess file you specified for the main directory is set to cache everything because you have the #filesmatch stuff commented out. This would cache everything, including stuff from .php files, and images, and...

# cache html/htm/xml/txt files for 2 days
#<FilesMatch "\.(html|htm|xml|txt|xsl)$">
Header set Cache-Control "max-age=172800, must-revalidate"
#</FilesMatch>

Re: [solved] admin pages cached in browser

Posted: Wed Jun 03, 2015 7:46 am
by HarmO
OK, Thx Calguy

I see it, that could be a problem indeed.
And also solves another problem i had with my sitemap.xml