knowledge-database (beta)

Current group: opera.tech

Caching of dynamic pages

Caching of dynamic pages  
swesti
 Re: Caching of dynamic pages  
Paul McGarry
 Re: Caching of dynamic pages  
swesti
 Re: Caching of dynamic pages  
Yngve Nysaeter Pettersen
 Re: Caching of dynamic pages  
swesti
From:swesti
Subject:Caching of dynamic pages
Date:4 Jan 2005 01:03:01 -0800
Hallo,

i create dynamic documents within an apache module. So, i add the
following http headers (not meta tags) to my documents in order not to
be cached.

browser must not cache:
Expires: Sun, 05 Dec 2004 00:00:00 GMT
Last-Modified: Tue, 04 Jan 2005 08:05:03 GMT (same as Date header,
the nowtime)

proxies must not cache:
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache

I tested the module with several browsers and OSes. IE, Mozilla,
Netscape, Firefox and Konqueror do not cache my documents (as wanted).
But Opera 7.x does cache my documents on Linux and Win. That seems
strange to me, because i found other posts, which explained, that
Opera does obey the Last-Modified/Expired header.

I read RFC2616 and think, that i am pretty RFC conform. Any hints?

CU
Sven
From:Paul McGarry
Subject:Re: Caching of dynamic pages
Date:Tue, 04 Jan 2005 20:28:24 +1100
On 4 Jan 2005 01:03:01 -0800, swesti wrote:

> I tested the module with several browsers and OSes. IE, Mozilla,
> Netscape, Firefox and Konqueror do not cache my documents (as wanted).
> But Opera 7.x does cache my documents on Linux and Win. That seems

Those cache control headers should do it.

What specifically do you mean by "Opera 7.x does cache my documents"?
Is Opera saving a copy in it's cache?

If not when is Opera showing a cached version when you think it shouldn't?

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
From:swesti
Subject:Re: Caching of dynamic pages
Date:Tue, 04 Jan 2005 18:08:18 +0100
Am Tue, 04 Jan 2005 20:28:24 +1100 schrieb Paul McGarry
:

> What specifically do you mean by "Opera 7.x does cache my documents"?
> Is Opera saving a copy in it's cache?
> If not when is Opera showing a cached version when you think it
> shouldn't?

When i request the dynamic document with the same URL for a second time, i
should get a new one (with different content), and not (how it incorrectly
happens) the same content as the one of the first request.

Well, in the simplest case, a document is a html page with e.g. a rondom
number, that is created by an apache modul on the server. I request
http://www.myserver.com/random.html twice. The first html page contains a
"123456" and the second should contain another random number.

I don't know where it is saved, but i suppose it is the cache. Isn't the
cache in the RAM, is it?


Thanks.
Sven
From:Yngve Nysaeter Pettersen
Subject:Re: Caching of dynamic pages
Date:Tue, 04 Jan 2005 19:51:08 GMT
On Tue, 04 Jan 2005 18:08:18 +0100, swesti wrote:

>Am Tue, 04 Jan 2005 20:28:24 +1100 schrieb Paul McGarry
>:
>
>> What specifically do you mean by "Opera 7.x does cache my documents"?
>> Is Opera saving a copy in it's cache?
>> If not when is Opera showing a cached version when you think it
>> shouldn't?
>
>When i request the dynamic document with the same URL for a second time, i
>should get a new one (with different content), and not (how it incorrectly
>happens) the same content as the one of the first request.
>
>Well, in the simplest case, a document is a html page with e.g. a rondom
>number, that is created by an apache modul on the server. I request
>http://www.myserver.com/random.html twice. The first html page contains a
>"123456" and the second should contain another random number.
>
>I don't know where it is saved, but i suppose it is the cache. Isn't the
>cache in the RAM, is it?

Does your server correctly handle If-Modified-Since requests? I've
seen a number of cases involving PHP where the server just looks at
the modified date of the PHP-file, not the result of processing the
PHP file, because it is not aware that the PHP file produces dynamic
content. And since your example uses random.html as the name, that may
be exactly what's going on.
From:swesti
Subject:Re: Caching of dynamic pages
Date:Thu, 06 Jan 2005 13:15:41 +0100
Yngve Nysaeter Pettersen wrote:

> Does your server correctly handle If-Modified-Since requests? I've
> seen a number of cases involving PHP where the server just looks at
> the modified date of the PHP-file, not the result of processing the
> PHP file, because it is not aware that the PHP file produces dynamic
> content. And since your example uses random.html as the name, that may
> be exactly what's going on.

Bingo. I did not pay attention to the request headers. There were a
If-Modified-Since and a If-None-Match headers in the request. Now i solved
the problem by deleting them before apache processes them in a later step
of the chain of the module hooks.

Thanks a lot!

CU
Sven
   

Copyright © 2006 knowledge-database   -   All rights reserved