Solved

Apache Caching Problem

Posted on 2007-04-05
3
241 Views
Last Modified: 2010-04-20
Howdy folks, I have a problem with apache caching. We are developing Flash applications so theres a lot of testing, changing, re-compiling, loading going on. Apache keeps caching these flash files so any changes we make arent visible as apache is obviously loading an older cached version of the same file.

I have solved this problem many months ago but we have had the hard drive with the apache config file on stolen and i cant remember the directive value for the life of me.

I know this is a case of loading the apache 'cache' module in apache and setting a directive (i assume 'CachDisable') . I want to disable caching accross all sites... so globably (we have many virtual hosts set up) but im not sure of the directive. I'm thinking its something along the lines of 'CacheDisable All' but im not even too sure where in the config file it should go.

Any help would be great and thanks in advance.
0
Comment
Question by:Damon_E
  • 2
3 Comments
 
LVL 15

Expert Comment

by:samri
ID: 18858441
hi Damon E,

i had the impression that the content is cached on the browser, and not on the server.

anyway, it would be possible to force apache to sent the "instruction" across in the HTTP_HEADER, so that the content is not cache.

I searched thru Apache docs website, and came across two modules that may sound workable for your situation -- mod_expire and mod_cache.

http://httpd.apache.org/docs/2.0/mod/mod_expires.html
This module controls the setting of the Expires  HTTP header and the max-age directive of the Cache-Control HTTP header in server responses. The expiration date can set to be relative to either the time the source file was last modified, or to the time of the client access.

These HTTP headers are an instruction to the client about the document's validity and persistence. If cached, the document may be fetched from the cache rather than from the source until this time has passed. After that, the cache copy is considered "expired" and invalid, and a new copy must be obtained from the source.

To modify Cache-Control directives other than max-age (see RFC 2616 section 14.9), you can use the Header directive.

or look at :

http://httpd.apache.org/docs/2.0/mod/mod_cache.html
http://httpd.apache.org/docs/2.0/mod/mod_headers.html


I just think that there are better options -- but give the standard setup a try.

Alternately, you could do hold the shift key while clicking on refresh button on the browser.  This would cause the web browser (i think most browser) would fetch a fresh copy from the server instead of local cache.

some external links that may look promising:
http://forums.powweb.com/showthread.php?p=409306
http://www.websiteoptimization.com/speed/tweak/cache/

HTH.
cheers.
0
 

Author Comment

by:Damon_E
ID: 18858598
Sorry In my haste to get this resolved i sacrificed thinking. Please disregard the 'Apache Caching' jazz, I'm mixing it up with 'flex server' (which does cache flash files server side) so I'll start again....

Yes, I do mean the expiration of local chached files and I'm very aware of HTTP header so sorry for the confusion. The solution i'm looking for is simply what 'value' to use with the 'CachDisable' directive of the 'mod_cache' module that will simply disable all caching for all sites. In the httpd.conf It's something along the lines of...

LoadModule cache_module modules/mod_cache.so
CacheDisable All

Its the 'All' im not too sure of and where in the config file i should put the directive to affect all sites (all virtual hosts). The documentation only mentions values specific to a directory you want to disable caching for and not what value to use if you want to disable it for all directories.

Cheers.
0
 
LVL 15

Accepted Solution

by:
samri earned 500 total points
ID: 18859143
Hi Damon E,

no problem at all mate!

We are all (at least I am), are just another support guy/gal that looks for ways to get things working.

since you had practically solved your own problem, you may recommed to PAQed this Question -- since I think the option that you had chosen is workable.

alternately, you could rate the comment appropriately -- in which I think just something I put down to try sorting the issue out.

cheers.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now