You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Frank Maas <fr...@cheiron-it.nl> on 2003/07/24 15:55:52 UTC

no_cache(1) and still cached?

Hi,

Recently I found some strange behaviour of the caching-functionality of
Apache. I had configured one httpd as caching proxy and a second one
creating the pages. Two kind of pages are created: dynamic ones (with
no_cache(1)) and static ones (with an expiry set to some minutes or
hours).
What I found was that sometimes users got served 'cached' dynamic pages.
Although the server should not cache the page it looked like this happened
whenever two requests were received at (nearly) the same time by the server.
Has anyone of you experienced this before and does this harm current ideas
about caching proxies?

--Frank


RE: no_cache(1) and still cached?

Posted by Frank Maas <fr...@cheiron-it.nl>.
> On Fri, 2003-07-25 at 04:32, Frank Maas wrote:
> Come to think of it, I have never had problems with mod_proxy caching
> thing I didn't want cached.  Quite the opposite -- I had to be very
> careful with Expires headers to get anything cached at all.
> 
> I think you might be mis-diagnosing the problem here.  Maybe it's an
> issue on the backend instead. 

Well, I thought that too, but couldn't get a grip on it. Picture the
situation I described before. Whenever a page is served outside it's
template, a logmessage is generated. Now when I see a page without
template on my screen (wrong) and I look in the logfile I see that 
only the allowed address is written as being served.
That's why I thought there was some optimisation in the cache engine
that limited the number of equal requests to the backend to one for
each URI. This would then even go beyond any headers, but more on the
principle of 'the page served at exactly the same moment is the same
page'...?

--Frank

PS: I now removed the caching mechanism from the setup and everything 
is working fine through the proxy. Whenever I cross this bridge again
I will start looking more closely.

RE: no_cache(1) and still cached?

Posted by Perrin Harkins <pe...@elem.com>.
On Fri, 2003-07-25 at 04:32, Frank Maas wrote:
> But the idea of setting the Expiry header back in time is appealing...

Come to think of it, I have never had problems with mod_proxy caching
thing I didn't want cached.  Quite the opposite -- I had to be very
careful with Expires headers to get anything cached at all.

I think you might be mis-diagnosing the problem here.  Maybe it's an
issue on the backend instead.

- Perrin

RE: no_cache(1) and still cached?

Posted by Frank Maas <fr...@cheiron-it.nl>.
> On Thu, 2003-07-24 at 09:55, Frank Maas wrote:
>> What I found was that sometimes users got served 'cached' dynamic
>> pages. Although the server should not cache the page it looked like
>> this happened whenever two requests were received at (nearly) the
>> same time by the server.
>
> What happens if you use Expires headers instead of the no_cache()
> stuff?

Good question... I will try that, but it's a bit difficult to test and
the repercussions aren't that great. I have two types of users on this
website: one, the general public, that gets every page fitted into a nice
template with menu, ads and stuff. Two, some co-sites, that get the bare
contents to put on their own site. Now what happened (quite often) was
that a type one user got a type two page... and so I was not making friends.
But the idea of setting the Expiry header back in time is appealing...
Thanks.

--Frank


Re: no_cache(1) and still cached?

Posted by Perrin Harkins <pe...@elem.com>.
On Thu, 2003-07-24 at 09:55, Frank Maas wrote:
> What I found was that sometimes users got served 'cached' dynamic pages.
> Although the server should not cache the page it looked like this happened
> whenever two requests were received at (nearly) the same time by the server.

What happens if you use Expires headers instead of the no_cache() stuff?

- Perrin