perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <gyo...@laserlink.net>
Subject FW: no_cache & pragma/cache-control headers : confusion
Date Tue, 10 Apr 2001 14:00:10 GMT
whoops - I CC'd the wrong address the first time...

> -----Original Message-----
> From: Andrew Ho [mailto:andrew@tellme.com]
> Sent: Thursday, April 05, 2001 4:19 AM
> To: mod_perl List
> Subject: Re: no_cache & pragma/cache-control headers : confusion
> 
> 
> Hello,
> 
> KO>From the code in Apache.xs, it seems like setting 
> $r->no_cache(0) will
> KO>unset 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.

the below patch seems to fix this 

--Geoff

Index: Apache.xs
===================================================================
RCS file: /home/cvspublic/modperl/src/modules/perl/Apache.xs,v
retrieving revision 1.119
diff -u -r1.119 Apache.xs
--- Apache.xs   2000/12/29 17:10:08     1.119
+++ Apache.xs   2001/04/10 13:52:56
@@ -1890,6 +1890,10 @@
        ap_table_setn(r->headers_out, "Pragma", "no-cache");
        ap_table_setn(r->headers_out, "Cache-control", "no-cache");
     }
+    else {
+       ap_table_unset(r->headers_out, "Pragma");
+       ap_table_unset(r->headers_out, "Cache-control");
+    }
 
     OUTPUT:
     RETVAL

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message