tags:

views:

662

answers:

3

I want to shut off all caching on my Apache running under Linux, and all caching on Firefox and... is there anyplace else I might be caching? I want my PHP and .css files to be fresh from disk all the time during development.

Disclaimer: I am asking about Apache as a dev tool, not as a deployment platform. If I ask about IIS and why it's caching .DLLs, it's considered a DEV question. This is also a dev question.

+2  A: 

Apache doesn't cache by default.

On firefox navigate to about:config and change browser.cache.disk.enabled and browser.cache.memory.enable to false.

If you are using a PHP framework that caches pages you will want to disable that, or be prepared to need to clear it manually.

The only other thing you may want to look for is if you are using a debugging proxy that it isn't caching any content as well.

JensenDied
Thanks. The fact that Apache isn't caching by default is helpful, because that was my fear.
Yar
check out http://httpd.apache.org/docs/2.2/caching.html for some of the Apache caching modules to ensure that they are either not loaded, or disabled for your development environment.
JensenDied
Apache may not cache by default if you built from source, but a pre-built apache, for example, in a LAMPP stack, may have a caching module installed and activated by default. You should check the Apache configuration to see what caches are active by default.
MiffTheFox
Thanks, I am in a LAMP stack and I am 100% sure that Apache is caching and that I am not insane :)
Yar
+1  A: 

Firefox caching disabling, in about:config:

  • set browser.cache.disk.enable to false
  • set browser.cache.memory.enable to false
  • set browser.cache.offline.enable to false
ASk
Excellent, thanks for that, trying it now.
Yar
A: 

Since you're using Firefox, might I briefly recommend the rather excellent Web Developer Toolbar by Chris Pederick? It's got a slew of options for disabling caching, JavaScript, manipulating sessions and cookies, etc.

Obviously, I'm recommending it to you for the caching options, but the rest of it is frequently extremely handy stuff. It might be more convenient than manually switching options over with about:config.

Rob
Yeah, turns out it's not Firefox that's causing the problem, as I'm trying in Safari right now... nice toolbar, though, thanks, I do use that...
Yar