You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Paul Cameron <pc...@bigpond.net.au> on 2008/12/21 23:27:00 UTC

[users@httpd] Apache 2.2.4 caching problem

I've been using Apache 2.2.4 for several weeks now to build a website on
a Ubuntu 7.10 Linux platform. I notice that whenever I make a change to
a static web page or style sheet, apache serves the old version of the
file instead of the new version. Running htcacheclean or clearing the
browser cache doesn't solve the problem. Apache still serves the old
version of the file. There are no error messages in the log file.

How do I get around this problem? Are there any directives I should be
using to refresh the cache? 

Thanks for any help, 

 
Paul Cameron
Email:	   <ma...@bigpond.net.au> pcn60@bigpond.net.au	
Phone:	  (07) 3102 5687	
Mobile:	  0410 442 756	
 

[users@httpd] Re: Apache 2.2.4 caching problem

Posted by Nicholas Sherlock <n....@gmail.com>.
André Warnier wrote:
> Paul Cameron wrote:
>> Thanks for responding to my question.
>> I've since downloaded firefox. When I tried to install LiveHttpHeaders,
>> it says that it's incompatible with the current version of firefox. 
> That's a real pity, because that plugin is really helpful for all kinds 
> of HTTP issues.
> I still use Firefox 2, and there it works.
> I believe there is another similar plugin, but don't remember its name.

"Tamper Data" works on Firefox 3. If you run it without entering 
"tamper" mode (which allows you to modify requests being made), it just 
presents a window where you can examine every request along with the 
request and response headers.

Cheers,
Nicholas Sherlock


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Apache 2.2.4 caching problem

Posted by Paul Cameron <pc...@bigpond.net.au>.
For the past few days, I've been making changes to style sheets and
static web pages, and every time, the browser would display the wrong
version i.e. the previous version. Suddenly, it all seems to be working
now, and I haven't made any material changes to either the browser or
web server. I can happily make changes to style sheets and static web
pages, and both firefox and IE will display the changed content.

Thanks everyone for your help.

-----Original Message-----
From: André Warnier [mailto:aw@ice-sa.com] 
Sent: Monday, 22 December 2008 10:48 AM
To: users@httpd.apache.org; users@httpd.apache.org
Subject: Re: [users@httpd] Apache 2.2.4 caching problem


Paul Cameron wrote:
> Thanks for responding to my question.
> 
> I've since downloaded firefox. When I tried to install 
> LiveHttpHeaders, it says that it's incompatible with the current 
> version of firefox.
That's a real pity, because that plugin is really helpful for all kinds 
of HTTP issues.
I still use Firefox 2, and there it works.
I believe there is another similar plugin, but don't remember its name.

If you feel like being a bit more adventurous, you could install perl on

the machine where the browser runs, and then use the "lwp-request" 
program that comes with perl.  It does the same as a browser, from the 
command-line, and there are plenty of options to display the HTTP 
headers circulating in one and the other direction.
I always use that one, but there may be other programs, lighter to 
install, that offer similar capabilities.
One advantage of lwp-request is that you can specify exactly which HTTP 
headers the client should send to the the server.  For caching issues 
that is useful.

> 
> I started firefox without importing any history, bookmarks, etc from 
> IE, but unfortunately, when I loaded the modified webpage, it 
> displayed the old version.
Ok, then it's a real puzzle.

  The webserver runs on a virtual machine on the same
> physical machine as the browser. The virtual machine is networked via 
> TCP. Between the browser and the server, there's a router, but the 
> virtual server for Internet users is disabled. So, the only two 
> players here are the browser and the apache server.
I do not quite understand how one of these implies the other, but at 
least it does not seem that you have a real proxy server in-between, 
which would be the second most-likely source of this kind of issue.

> 
> More info ...
> I changed the style sheet, and reloaded the page. The access.log entry
> is:
> 
> "GET /css/reports.css HTTP/1.1" \
> 200 3964 "http://192.168.0.137/headerframe.html" "Mozilla/5.0 
> (Windows; U; Wind\ ows NT 5.1; en-GB; rv:1.9.0.5) Gecko/2008120122 
> Firefox/3.0.5"
> 
> The file size of reports.css is:
> 
> [paul@Develop:/var/www/css]l reports.css
> -rw-r--r-- 1 paul dev 3985 2008-12-22 09:36 reports.css
> 
> So, it seems that apache is recognising that the content has been 
> modified but is serving a cached version of the file.

On the face of it, it does not make any sense.
If you ask directly for the stylesheet in the URL bar of the browser, 
and then save it to disk, which  one is it and what size does it have ?


In your earlier post, you mentioned something about "htcacheclean". Do
you have mod_cache active on the server ? If yes, can you turn it off ?

> 
> Do you have any further suggestions?
> 

A wild guess : what is the time on these 2 machines ?
command: date



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project. See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2.4 caching problem

Posted by André Warnier <aw...@ice-sa.com>.
Paul Cameron wrote:
> Thanks for responding to my question. 
> 
> I've since downloaded firefox. When I tried to install LiveHttpHeaders,
> it says that it's incompatible with the current version of firefox. 
That's a real pity, because that plugin is really helpful for all kinds 
of HTTP issues.
I still use Firefox 2, and there it works.
I believe there is another similar plugin, but don't remember its name.

If you feel like being a bit more adventurous, you could install perl on 
the machine where the browser runs, and then use the "lwp-request" 
program that comes with perl.  It does the same as a browser, from the 
command-line, and there are plenty of options to display the HTTP 
headers circulating in one and the other direction.
I always use that one, but there may be other programs, lighter to 
install, that offer similar capabilities.
One advantage of lwp-request is that you can specify exactly which HTTP 
headers the client should send to the the server.  For caching issues 
that is useful.

> 
> I started firefox without importing any history, bookmarks, etc from IE,
> but unfortunately, when I loaded the modified webpage, it displayed the
> old version.
Ok, then it's a real puzzle.

  The webserver runs on a virtual machine on the same
> physical machine as the browser. The virtual machine is networked via
> TCP. Between the browser and the server, there's a router, but the
> virtual server for Internet users is disabled. So, the only two players
> here are the browser and the apache server. 
I do not quite understand how one of these implies the other, but at 
least it does not seem that you have a real proxy server in-between, 
which would be the second most-likely source of this kind of issue.

> 
> More info ...
> I changed the style sheet, and reloaded the page. The access.log entry
> is:
> 
> "GET /css/reports.css HTTP/1.1" \
> 200 3964 "http://192.168.0.137/headerframe.html" "Mozilla/5.0 (Windows;
> U; Wind\
> ows NT 5.1; en-GB; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5"
> 
> The file size of reports.css is:
> 
> [paul@Develop:/var/www/css]l reports.css
> -rw-r--r-- 1 paul dev 3985 2008-12-22 09:36 reports.css
> 
> So, it seems that apache is recognising that the content has been
> modified but is serving a cached version of the file. 

On the face of it, it does not make any sense.
If you ask directly for the stylesheet in the URL bar of the browser, 
and then save it to disk, which  one is it and what size does it have ?


In your earlier post, you mentioned something about "htcacheclean".
Do you have mod_cache active on the server ?
If yes, can you turn it off ?

> 
> Do you have any further suggestions?
> 

A wild guess : what is the time on these 2 machines ?
command: date



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Apache 2.2.4 caching problem

Posted by Paul Cameron <pc...@bigpond.net.au>.
Thanks for responding to my question. 

I've since downloaded firefox. When I tried to install LiveHttpHeaders,
it says that it's incompatible with the current version of firefox. 

I started firefox without importing any history, bookmarks, etc from IE,
but unfortunately, when I loaded the modified webpage, it displayed the
old version. The webserver runs on a virtual machine on the same
physical machine as the browser. The virtual machine is networked via
TCP. Between the browser and the server, there's a router, but the
virtual server for Internet users is disabled. So, the only two players
here are the browser and the apache server. 

More info ...
I changed the style sheet, and reloaded the page. The access.log entry
is:

"GET /css/reports.css HTTP/1.1" \
200 3964 "http://192.168.0.137/headerframe.html" "Mozilla/5.0 (Windows;
U; Wind\
ows NT 5.1; en-GB; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5"

The file size of reports.css is:

[paul@Develop:/var/www/css]l reports.css
-rw-r--r-- 1 paul dev 3985 2008-12-22 09:36 reports.css

So, it seems that apache is recognising that the content has been
modified but is serving a cached version of the file. 

Do you have any further suggestions?

-----Original Message-----
From: André Warnier [mailto:aw@ice-sa.com] 
Sent: Monday, 22 December 2008 8:55 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Apache 2.2.4 caching problem


Paul Cameron wrote:
[...]
In my (quite deep) experience, with 99% probability it is not a problem 
of Apache, but it is a problem of either not really clearing your 
browser's cache, or of a proxy server in-between that keeps the old 
versions in its cache.
These things can really be a pain.

(And I'm just saying this so that you would not go and spend maybe a lot

of time investigating an issue in the wrong place).

First try the obvious : press the SHIFT button on your keyboard, and at 
the same time click the reload icon.

If that doesn't help, clear your browser cache again, close your 
browser, open it again, clear the cache again, and reload the page, if 
needed by the method above again.

If that doesn't help, get Firefox if you do not have it yet, and add to 
it the LiveHttpHeaders add-on/plugin.  It adds an item in Tools, call it

up, and without closing that window, go back to the main window and call

the page again.  Then go back to the LiveHttpHeaders window, and follow 
the exchange between the browser and the server.
If you are seeing answers from the server with code 30x (not_modified 
etc..), then you still have an issue with the browser cache.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project. See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2.4 caching problem

Posted by André Warnier <aw...@ice-sa.com>.
Paul Cameron wrote:
[...]
In my (quite deep) experience, with 99% probability it is not a problem 
of Apache, but it is a problem of either not really clearing your 
browser's cache, or of a proxy server in-between that keeps the old 
versions in its cache.
These things can really be a pain.

(And I'm just saying this so that you would not go and spend maybe a lot 
of time investigating an issue in the wrong place).

First try the obvious : press the SHIFT button on your keyboard, and at 
the same time click the reload icon.

If that doesn't help, clear your browser cache again, close your 
browser, open it again, clear the cache again, and reload the page, if 
needed by the method above again.

If that doesn't help, get Firefox if you do not have it yet, and add to 
it the LiveHttpHeaders add-on/plugin.  It adds an item in Tools, call it 
up, and without closing that window, go back to the main window and call 
the page again.  Then go back to the LiveHttpHeaders window, and follow 
the exchange between the browser and the server.
If you are seeing answers from the server with code 30x (not_modified 
etc..), then you still have an issue with the browser cache.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org