Received: (qmail 11921 invoked by uid 2012); 17 Sep 1998 15:07:02 -0000 Message-Id: <19980917150702.11920.qmail@hyperreal.org> Date: 17 Sep 1998 15:07:02 -0000 From: Ask Bjoern Hansen Reply-To: ask@netcetera.dk To: apbugs@hyperreal.org Subject: r->no_cache should set the Pragma and maybe the cache-control header X-Send-Pr-Version: 3.2 >Number: 3023 >Category: apache-api >Synopsis: r->no_cache should set the Pragma and maybe the cache-control header >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Class: change-request >Submitter-Id: apache >Arrival-Date: Thu Sep 17 08:10:01 PDT 1998 >Last-Modified: Mon Dec 28 05:08:00 PST 1998 >Originator: ask@netcetera.dk >Organization: >Release: 1.3.2-dev >Environment: not relevant >Description: r->no_cache should set the Pragma and maybe the cache-control header and not only an expire header which not always does the job. >How-To-Repeat: >Fix: diff -c -r1.239 http_protocol.c *** http_protocol.c 1998/08/25 09:15:31 1.239 --- http_protocol.c 1998/09/17 14:59:10 *************** *** 1295,1300 **** --- 1295,1302 ---- if (r->no_cache && !ap_table_get(r->headers_out, "Expires")) ap_table_addn(r->headers_out, "Expires", ap_gm_timestr_822(r->pool, r->request_time)); + ap_table_addn(r->headers_out, "Pragma", "no-cache"); + ap_table_addn(r->headers_out, "Cache-control", "no-cache"); /* Send the entire table of header fields, terminated by an empty line. */ >Audit-Trail: From: Ask Bjoern Hansen To: apbugs@hyperreal.org, apache-bugdb@apache.org Cc: Subject: Re: apache-api/3023: r->no_cache should set the Pragma and maybe the cache-control header Date: Thu, 17 Sep 1998 18:22:42 +0200 (CEST) Eeschk.. My tests wasn't any good. This patch should work: *** http_protocol.c 1998/08/25 09:15:31 1.239 --- http_protocol.c 1998/09/17 16:20:30 *************** *** 1292,1300 **** * Control cachability for non-cachable responses if not already set by * some other part of the server configuration. */ ! if (r->no_cache && !ap_table_get(r->headers_out, "Expires")) ap_table_addn(r->headers_out, "Expires", ap_gm_timestr_822(r->pool, r->request_time)); /* Send the entire table of header fields, terminated by an empty line. */ --- 1292,1303 ---- * Control cachability for non-cachable responses if not already set by * some other part of the server configuration. */ ! if (r->no_cache && !ap_table_get(r->headers_out, "Expires")) { ap_table_addn(r->headers_out, "Expires", ap_gm_timestr_822(r->pool, r->request_time)); + ap_table_addn(r->headers_out, "Pragma", "no-cache"); + ap_table_addn(r->headers_out, "Cache-control", "no-cache"); + } /* Send the entire table of header fields, terminated by an empty line. */ ask -- ask bjoern hansen - http://www.netcetera.dk/ State-Changed-From-To: open-closed State-Changed-By: fielding State-Changed-When: Mon Dec 28 05:08:00 PST 1998 State-Changed-Why: The "Pragma: no-cache" has no meaning in a response for HTTP/1.0 or HTTP/1.1, regardless of what some other applications do in reaction to that field. Also, the no_cache indicator in the request_rec exists ONLY to replicate the functionality of the Vary field in HTTP/1.1. It is therefore not appropriate to add Pragma or Cache-Control to such responses. If such is desired for specific resources, then it would be better to use mod_headers to directly control these fields. >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ] [If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request ] [from a developer. ] [Reply only with text; DO NOT SEND ATTACHMENTS! ]