no-cache headers?
I've a note in the guide to check the correctness of the following section. I have these 2 questions: 1. Should all three headers be always sent? 2. Should $r-no_cache(1) be used for non-2xx responses? Thanks! =head1 Cache Control for Regular and Error Modes To disable the client response caching these HTTP headers should be used: Pragma: no-cache Cache-control: no-cache Expires: Wed, 21 Mar 2001 00:28:13 GMT where the IExpires field is set to the same date and time as the original request. For normally generated response use: $r-header_out("Pragma","no-cache"); $r-header_out("Cache-control","no-cache"); $r-no_cache(1); If for some reason you need to use them in Error control code (i.e. when sending some non-2xx response code) use: $r-err_header_out("Pragma","no-cache"); $r-err_header_out("Cache-control","no-cache"); $r-no_cache(1); _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://logilune.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
RE: no-cache headers?
-Original Message- From: Stas Bekman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 20, 2001 11:44 AM To: mod_perl list Subject: no-cache headers? I've a note in the guide to check the correctness of the following section. I have these 2 questions: 1. Should all three headers be always sent? 2. Should $r-no_cache(1) be used for non-2xx responses? Thanks! =head1 Cache Control for Regular and Error Modes To disable the client response caching these HTTP headers should be used: Pragma: no-cache Cache-control: no-cache Expires: Wed, 21 Mar 2001 00:28:13 GMT where the IExpires field is set to the same date and time as the original request. For normally generated response use: $r-header_out("Pragma","no-cache"); $r-header_out("Cache-control","no-cache"); $r-no_cache(1); $r-no_cache(1) sets these headers for you - no need to set them yourself. If for some reason you need to use them in Error control code (i.e. when sending some non-2xx response code) use: $r-err_header_out("Pragma","no-cache"); $r-err_header_out("Cache-control","no-cache"); $r-no_cache(1); I don't think this is necessary http://archive.covalent.net/perl/dev/2000/09/0042.xml --Geoff _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://logilune.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
RE: no-cache headers?
On Tue, 20 Mar 2001, Geoffrey Young wrote: For normally generated response use: $r-header_out("Pragma","no-cache"); $r-header_out("Cache-control","no-cache"); $r-no_cache(1); $r-no_cache(1) sets these headers for you - no need to set them yourself. If for some reason you need to use them in Error control code (i.e. when sending some non-2xx response code) use: $r-err_header_out("Pragma","no-cache"); $r-err_header_out("Cache-control","no-cache"); $r-no_cache(1); I don't think this is necessary http://archive.covalent.net/perl/dev/2000/09/0042.xml In fact it's well covered in here: http://perl.apache.org/guide/correct_headers.html Sometimes I myself get lost in all the amount of information the guide includes... so I've removed this duplication section. Andreas Koenig's doc is the right one to stick too. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/