You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Rasoul Hajikhani <ra...@rhythm.com> on 2001/11/15 23:48:18 UTC
no_cache()
Hello folks,
I am using $request_object->no_cache(1) with no success. Isn't it
supported any more? Can some one shed some light on this for me...
#set the content type
$big_r->content_type('text/html');
$big_r->no_cache(1);
# some more code
return OK;
thanks in advance.
-r
Re: no_cache()
Posted by Rasoul Hajikhani <ra...@rhythm.com>.
Rob Bloodgood wrote:
>
> > #set the content type
> > $big_r->content_type('text/html');
> > $big_r->no_cache(1);
> >
> > # some more code
> >
> > return OK;
>
> You *are* remembering to do
>
> $r->send_http_header();
>
> somewhere in (some more code), arent you?
>
> L8r,
> Rob
> #!/usr/bin/perl -w
> use Disclaimer qw/:standard/;
>
Well then, that's what was missing :(...
thanks
-r
RE: no_cache()
Posted by Rob Bloodgood <ro...@empire2.com>.
> #set the content type
> $big_r->content_type('text/html');
> $big_r->no_cache(1);
>
> # some more code
>
> return OK;
You *are* remembering to do
$r->send_http_header();
somewhere in (some more code), arent you?
L8r,
Rob
#!/usr/bin/perl -w
use Disclaimer qw/:standard/;
Re: no_cache()
Posted by Stas Bekman <st...@stason.org>.
David Wheeler wrote:
> Huh, according to the mod_perl guide:
>
> http://thingy.kcilink.com/modperlguide/correct_headers/2_1_3_Expires_and_Cache_Control.html
>
> Those headers are not added by no_cache(1). But I see that, according to
> the mod_perl Changes file, those headers were added to the behavior of
> no_cache(1) in mod_perl 1.21_01. So perhaps the mod_perl guide should be
> changed from its current documentation:
>
> my $headers = $r->headers_out;
> $headers->{'Pragma'} = $headers->{'Cache-control'} = 'no-cache';
> $r->no_cache(1);
>
> To simply:
>
> $r->no_cache(1).
>
> Stas?
Thanks David, fixed in the cvs version.
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
RE: no_cache()
Posted by David Wheeler <da...@wheeler.net>.
On Fri, 2001-11-16 at 11:59, Kyle Oppenheim wrote:
> $r->no_cache(1) adds the headers "Pragma: no-cache" and "Cache-control:
> no-cache".
<snip />
Huh, according to the mod_perl guide:
http://thingy.kcilink.com/modperlguide/correct_headers/2_1_3_Expires_and_Cache_Control.html
Those headers are not added by no_cache(1). But I see that, according to
the mod_perl Changes file, those headers were added to the behavior of
no_cache(1) in mod_perl 1.21_01. So perhaps the mod_perl guide should be
changed from its current documentation:
my $headers = $r->headers_out;
$headers->{'Pragma'} = $headers->{'Cache-control'} = 'no-cache';
$r->no_cache(1);
To simply:
$r->no_cache(1).
Stas?
Regards,
David
--
David Wheeler AIM: dwTheory
David@Wheeler.net ICQ: 15726394
Yahoo!: dew7e
Jabber: Theory@jabber.org
RE: no_cache()
Posted by Kyle Oppenheim <ky...@tellme.com>.
$r->no_cache(1) adds the headers "Pragma: no-cache" and "Cache-control:
no-cache". So, you need to call no_cache before calling
$r->send_http_header. You can verify that it works by looking at the
headers returned by the server when you request your document. If your
browser is caching the page w/o regard to these headers, then it's your
browser, not mod_perl that's broken or misconfigured.
- Kyle
> -----Original Message-----
> From: rasoul@rhythm.com [mailto:rasoul@rhythm.com]
> Sent: Friday, November 16, 2001 10:48 AM
> To: Ask Bjoern Hansen
> Cc: modperl@apache.org
> Subject: Re: no_cache()
>
>
> Ask Bjoern Hansen wrote:
> >
> > On Thu, 15 Nov 2001, Rasoul Hajikhani wrote:
> >
> > > I am using $request_object->no_cache(1) with no success. Isn't it
> > > supported any more? Can some one shed some light on this for me...
> >
> > What do you mean with "no success"? What are you trying to do?
> >
> > --
> > ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
> > more than a billion impressions per week, http://valueclick.com
>
> Well the cached document is returned rather than the new one. I know
> this because I make cosmetic changes to the document, reload it, and
> voila, still the old document. I have cleared the cache, set the cache
> size to 0, have even restarted the server at times just in case, but the
> result has been frantic. Sometimes the new document is shown on reloads,
> and at other times the old one is shown.
> -r
Re: no_cache()
Posted by Rasoul Hajikhani <ra...@rhythm.com>.
Ask Bjoern Hansen wrote:
>
> On Thu, 15 Nov 2001, Rasoul Hajikhani wrote:
>
> > I am using $request_object->no_cache(1) with no success. Isn't it
> > supported any more? Can some one shed some light on this for me...
>
> What do you mean with "no success"? What are you trying to do?
>
> --
> ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
> more than a billion impressions per week, http://valueclick.com
Well the cached document is returned rather than the new one. I know
this because I make cosmetic changes to the document, reload it, and
voila, still the old document. I have cleared the cache, set the cache
size to 0, have even restarted the server at times just in case, but the
result has been frantic. Sometimes the new document is shown on reloads,
and at other times the old one is shown.
-r
Re: no_cache()
Posted by Ask Bjoern Hansen <as...@valueclick.com>.
On Thu, 15 Nov 2001, Rasoul Hajikhani wrote:
> I am using $request_object->no_cache(1) with no success. Isn't it
> supported any more? Can some one shed some light on this for me...
What do you mean with "no success"? What are you trying to do?
--
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
more than a billion impressions per week, http://valueclick.com