Strange Caching Error

Permalink
Every time I modify my CSS file I don't see any changes to my concrete 5 site until I clear my cache in browser. I'm realizing now that this effects anyone using my website.

I've tried turning off the cache and clearing the cache within the concrete 5 interface. The only thing that seems to help is clearing the cache through my browser. This is a pretty big problem as any client who goes to my website will not see new content I add until they clear their browser (which lets be honest, they never do.)

Does anyone have a solution for me? I should also note I'm running a really old version of concrete (5.6) Could updating help me with this issue?

Thanks

 
SeanDevoy replied on at Permalink Reply
Hi,

This is sort of not a C5 problem. Anytime a website returns cache-able content by including an expiration date, the browser "remembers" that this file does not need to be downloaded until it expires.

So, if the server sends a CSS file with an expires date of tomorrow, all browsers cache it. Then you change the date on the server, all new browser requests get the file with caching disabled. However, browsers that still have a non-expired original version don't know the file is no longer cached until this one expires and it re-loads it.

I THINK C5 has an option to limiit cache to "n" Hours. To help with this very issue.

The result is that enabling caching on a server results in "current" users not getting changes until they expire or the browser is cleared. This is great for very STATIC files and sucks when you want to push a change through quickly!

HTH,
Sean
migtybjorn replied on at Permalink Reply
How would you suggest going about correcting this? Contacting my network administrator?
SeanDevoy replied on at Permalink Reply
Only if this is a file you are including the <link> or <script> tag for, not the ones automatically done by C5. For those files you just add a parameter to the filename like "script.css?v=1.0". Then change that parameter when you want to force a change through.

For C5 files handled automatically, like from a CSS folder, change the filename and it will be forced to load.

Sean
migtybjorn replied on at Permalink Reply
There has to be a better fix than this. This is not standard behavior for caching. On all of my work FTP servers I can modify a CSS file and see the changes without clearing my browser cache.

Here I have to clear my browser cache to see every single little change I make whether it is something I'm changing on a C5 page, or changes I make to a CSS file and upload it to my FTP server.

Something isn't working the way it should be, there is no doubt about that.
SeanDevoy replied on at Permalink Reply
File caching must be enabled on the Web Server for the site and the file types that can be cached and how long they can be cached. Since this can be such a mind boggling problem to diagnose, many hosting companies do not enable caching on CSS and JS files.

You can tell if it is enabled here:http://www.webpagetest.org/ by entering the url.

I have had this problem on dozens of non-C5 sites on my own server. I typically disable cache on those sites until they are stable/static.

Alternatively, you can disable caching on your browser at least for a while, see these links:
Chrome:https://www.technipages.com/google-chrome-how-to-completely-disable-...
FF:http://stackoverflow.com/questions/20884511/how-can-i-turn-off-cach...
IE: ?

Sean
migtybjorn replied on at Permalink Reply
Thanks! I have already emailed my network admin asking about this.

You've been very helpful!
SeanDevoy replied on at Permalink Reply
Oh, I forgot to mention this is ABSOLUTELY standard behavior for caching. It is specifically designed to allow browsers to "cache" files and not request them from the server. Trying to overcome caching that is enabled is not so very easy.