[solved] admin pages cached in browser

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

[solved] admin pages cached in browser

Post 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>
Last edited by HarmO on Tue Jun 02, 2015 11:37 am, edited 1 time in total.
Kind regards,
HarmO
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

Re: admin pages cached in browser

Post by HarmO »

I made a htaccess file that disables caching and placed it in the admin folder. problem solved.
Kind regards,
HarmO
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: [solved] admin pages cached in browser

Post 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>
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm

Re: [solved] admin pages cached in browser

Post 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
Kind regards,
HarmO
Post Reply

Return to “The Lounge”