1

I have a problem with .css files not being updated while I change it, and everything points to caching. I have cleared browser cache, added versioning, or even changed the link to another .css file, but nothing helped.

There are two subquestion:
a) what else can I do about caching issues?
b) when can I be sure that every possible solution was tested and not working, so it's highly unlikely that the problem is in caching?

Both .php and .css files are on localhost, in XAMPP sandbox - when the previous options failed, I suspect the problem might be either in Apache or in any other part of XAMPP, or that Firefox treats it somewhat special for not being in the "real internet", and thus didn't remove cache for it despite advertising "no cache".

EDIT: I use Firefox 21.0. I tried the same under Google Chrome 27.0.1453.116 m, with no effect too.

EDIT2: the original question was resolved, and it proved NOT to be about caching. Just in case it would help anyone in the future, I add a brief list of related questions and accept the answer that adds something new to their answers:

Stylesheet not updating

Firefox browser does not reload the update CSS/JS files

What is an elegant way to force browsers to reload cached CSS/JS files?

Making sure a web page is not cached, across all browsers

And, finally, one from super user:

Config xampp never to cache pages from localhost

Community
  • 1
  • 1
Pavel V.
  • 2,295
  • 9
  • 36
  • 70

2 Answers2

2

Have you tried modifying the cache control in the htaccess file?

Try this

http://www.chicagostyleseo.com/2010/04/googles-need-for-speed-use-cache-and-htaccess-to-speed-up-your-site/

This has the cache control code for your hit access file

Liam Sorsby
  • 2,634
  • 2
  • 24
  • 49
  • Please be aware this could effect your websites efficiency loading the pages and media so be careful! – Liam Sorsby Jun 26 '13 at 23:04
  • +1. It has shown me another way to try. I created .htaccess file and inserted code from [this link](http://www.askapache.com/htaccess/using-http-headers-with-htaccess.html#100_Prevent_Files_cached) to it. Unfortunately, nothing changed. It is my own Apache localhost server, so being blocked by a server admin doesn't seem possible. Performance issues are no problem during development. – Pavel V. Jun 26 '13 at 23:18
  • What are the headers for the CSS document? Does it have an expire date? Also have you tried just simply going onto the CSS file and pressing ctrl+f5? – Liam Sorsby Jun 26 '13 at 23:21
0

This is one of the best article available to prevent CSS Caching
Can We Prevent CSS Caching?
Update on CSS Caching

VenomVendor
  • 14,120
  • 11
  • 63
  • 89