Re: no_cache pragma/cache-control headers : confusion

2001-04-05 Thread Andrew Ho

Hello,

KOFrom the code in Apache.xs, it seems like setting $r-no_cache(0) will
KOunset the flag, but not remove the headers.

Well, the Expires header is also removed. But it's still broken; you can
verify this buggy behavior with this simple script:

use Apache ();
my $r = Apache-request;

$r-no_cache(1);
$r-no_cache(0);
$r-send_http_header;

With mod_perls 1.24_01 and 1.25 on Apaches 1.3.14 and 1.3.19, this call
leaves me with Pragma and Cache-Control headers. Sadly, the nice (but
broken as per above) no_cache() behavior of sending those two headers is
also undocumented in the mod_perl guide to begin with.

Humbly,

Andrew

--
Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
Engineer   [EMAIL PROTECTED]  Voice 650-930-9062
Tellme Networks, Inc.   1-800-555-TELLFax 650-930-9101
--




no_cache pragma/cache-control headers : confusion

2001-04-04 Thread Patrick

Dear all,

There is some kind of confusion in my head, and the Eagle book seems
to me even more confusing. Any help appreciated.

First, I always thought that no_cache() does everything regarding
headers, and that you have just to turn it on or off.
However I discovered yesterday that, at least in my setup, even with
no_cache(0) I have
Pragma: no-cache
Cache-control: no-cache
which seems counter-intuitive to me.

I've checked the Eagle : it says that no_cache() only adds an Expires
field.
Ok. But then from where does the Pragma header come ?

About -headers_out() it is specifically said : In addition, the
Pragma: no-cache idiom, used to tell browsers not to cache the
document, should be set indirectly using the no_cache() method.

So, that seems confusing to me, since the no_cache() methods seem not
to deal with Pragma headers.

Who sets Pragma/Cache-control headers and why are they like that by
default ?
How to override that (with headers_out ?) ?

TIA.

-- 
Patrick.
``C'est un monde qui n'a pas les moyens de ne plus avoir mal.''



RE: no_cache pragma/cache-control headers : confusion

2001-04-04 Thread Kyle Oppenheim

Apache (as in httpd) will set the 'Expires' header to the same value as the
'Date' header when no_cache is flagged in the request_rec.  When your Perl
handler sets $r-no_cache(1), mod_perl (in Apache.xs) is setting the
'Pragma: no-cache' and 'Cache-control: no-cache' headers in addition to
setting the no_cache flag in the request_rec.  From the code in Apache.xs,
it seems like setting $r-no_cache(0) will unset the flag, but not remove
the headers.

--
Kyle Oppenheim
Tellme Networks, Inc.
http://www.tellme.com


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Patrick
Sent: Wednesday, April 04, 2001 2:47 AM
To: [EMAIL PROTECTED]
Subject: no_cache  pragma/cache-control headers : confusion


Dear all,

There is some kind of confusion in my head, and the Eagle book seems
to me even more confusing. Any help appreciated.

First, I always thought that no_cache() does everything regarding
headers, and that you have just to turn it on or off.
However I discovered yesterday that, at least in my setup, even with
no_cache(0) I have
Pragma: no-cache
Cache-control: no-cache
which seems counter-intuitive to me.

I've checked the Eagle : it says that no_cache() only adds an Expires
field.
Ok. But then from where does the Pragma header come ?

About -headers_out() it is specifically said : In addition, the
Pragma: no-cache idiom, used to tell browsers not to cache the
document, should be set indirectly using the no_cache() method.

So, that seems confusing to me, since the no_cache() methods seem not
to deal with Pragma headers.

Who sets Pragma/Cache-control headers and why are they like that by
default ?
How to override that (with headers_out ?) ?

TIA.

--
Patrick.
``C'est un monde qui n'a pas les moyens de ne plus avoir mal.''




Cache control

2000-05-26 Thread Tom Mornini

I have written a handler for delivering select images for a particular
class of URIs based upon a database item that the user sets in advance.
This allows us to "skin" some HTML allowing the user to select their look
of choice.

The problem I have is that IE5 (and perhaps other browsers and versions)
but NOT Netscape 4.x have absolutely no respect for cache-control.

My code does this:

  $r-no_cache(1);

  # some code to calculate a date 10 years ago (!) goes here...

  $r-header_out(
'Expires' = "$day_text, $day $mon_text $year $hour:$min:$sec GMT"
  );

  $r-send_http_header($subreq-content_type);

And the HTTP headers via Lynx look like this:

HTTP/1.0 200 OK
Date: Fri, 26 May 2000 08:58:38 GMT
Server: Apache/1.3.12 (Unix) mod_perl/1.23
Pragma: no-cache
Cache-control: no-cache
Expires: Tue, 29 May 1990 1:58:38 GMT
Content-length: 1332
Content-Type: image/gif

But IE5 still caches the damn things! Does anyone have a suggestion?
Please note that I don't have the ability to modify the IMG SRC
dynamically since the HTML resides on our customers' servers.

-- 
-- Tom Mornini
-- InfoMania Printing and Prepress




RE: Cache control

2000-05-26 Thread Eric Jain

 The problem I have is that IE5 (and perhaps other browsers
 and versions)
 but NOT Netscape 4.x have absolutely no respect for cache-control.

IE5 can be set up to ignore any cache directives and keep a document
for either the duration of the session or forever. (Or reload it every
single time or check if it should be reloaded...)

This might be the cause of its respectlessness :-)


--
Eric Jain






[OT] Re: Cache control

2000-05-26 Thread Drew Taylor

Tom Mornini wrote:
 
 I have written a handler for delivering select images for a particular
 class of URIs based upon a database item that the user sets in advance.
 This allows us to "skin" some HTML allowing the user to select their look
 of choice.
 
 The problem I have is that IE5 (and perhaps other browsers and versions)
 but NOT Netscape 4.x have absolutely no respect for cache-control.

 But IE5 still caches the damn things! Does anyone have a suggestion?
 Please note that I don't have the ability to modify the IMG SRC
 dynamically since the HTML resides on our customers' servers.
I don't yet have a suggestion, but I have the same problem with IE. I'm
building a web-based admin section, and IE keeps caching everything. One
more reason to hate IE - on IE 5 Mac they changed the default resolution
to 96 dpi (up from the std 72 dpi). So now all our style sheets for the
mac side have to be tweaked, and I have a lot of code to rework to send
the proper stylesheet! Microsoft seems to be very partial to standards -
CSS1 is completely implemented in IE5 mac, but it still caches dynamic
content!

Anyway, sorry for the OT post. I just had to vent... :-)

-- 
Drew Taylor
Vialogix Communications, Inc.
501 N. College Street
Charlotte, NC 28202
704 370 0550
http://www.vialogix.com/



Re: Cache control

2000-05-26 Thread Nick Tonkin


In our experience the only thing that guarantees no cacheing is returning
302. Also appending a query string (even an empty one) to the redirect URI
seems to make it even more solid.

So in your script you would build up your destination URI, append
'?foo=bar' to the end of it, and return it as a redirect. That way not
even MSIE will cache it.

HTH,

Nick


On Fri, 26 May 2000, Tom Mornini wrote:

 I have written a handler for delivering select images for a particular
 class of URIs based upon a database item that the user sets in advance.
 This allows us to "skin" some HTML allowing the user to select their look
 of choice.
 
 The problem I have is that IE5 (and perhaps other browsers and versions)
 but NOT Netscape 4.x have absolutely no respect for cache-control.
 
 My code does this:
 
   $r-no_cache(1);
 
   # some code to calculate a date 10 years ago (!) goes here...
 
   $r-header_out(
 'Expires' = "$day_text, $day $mon_text $year $hour:$min:$sec GMT"
   );
 
   $r-send_http_header($subreq-content_type);
 
 And the HTTP headers via Lynx look like this:
 
 HTTP/1.0 200 OK
 Date: Fri, 26 May 2000 08:58:38 GMT
 Server: Apache/1.3.12 (Unix) mod_perl/1.23
 Pragma: no-cache
 Cache-control: no-cache
 Expires: Tue, 29 May 1990 1:58:38 GMT
 Content-length: 1332
 Content-Type: image/gif
 
 But IE5 still caches the damn things! Does anyone have a suggestion?
 Please note that I don't have the ability to modify the IMG SRC
 dynamically since the HTML resides on our customers' servers.
 
 -- 
 -- Tom Mornini
 -- InfoMania Printing and Prepress
 
 


- nick





Re: Cache control

2000-05-26 Thread Tom Mornini

On Fri, 26 May 2000, Nick Tonkin wrote:

 In our experience the only thing that guarantees no cacheing is returning
 302. Also appending a query string (even an empty one) to the redirect URI
 seems to make it even more solid.
 
 So in your script you would build up your destination URI, append
 '?foo=bar' to the end of it, and return it as a redirect. That way not
 even MSIE will cache it.

Though you walk the Earth, you may indeed be a God! Thank you very much.

I wish I would have thought of this myself.

-- 
-- Tom Mornini
-- InfoMania Printing and Prepress