You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ian Holsman <ia...@cnet.com> on 2001/09/14 21:08:37 UTC

304's and mod-include

found something interesting.

a mod-included page (which by it's nature is dynamic)
is getting 304's returned instead of running the page.


I'm just wondering if we should remove the 'Last-Modified' and 'ETag'
fields from the header-out response. (like we do with the
content-length)

-- 
Ian Holsman          IanH@cnet.com
Performance Measurement & Analysis
CNET Networks   -   (415) 364-8608


Re: 304's and mod-include --PATCH

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Fri, Sep 14, 2001 at 12:40:14PM -0700, Ian Holsman wrote:
> here is a patch which does just that.
> 
> Index: mod_include.c
> ===================================================================
> RCS file: /home/cvspublic/httpd-2.0/modules/filters/mod_include.c,v
> retrieving revision 1.146
> diff -u -u -r1.146 mod_include.c
> --- mod_include.c       2001/09/10 03:58:26     1.146
> +++ mod_include.c       2001/09/14 19:34:17
> @@ -3081,6 +3081,13 @@
>       * the content-length should just be unset.
>       */
>      apr_table_unset(f->r->headers_out, "Content-Length");
> +    /*
> +     * Always unset the ETag/Last-Modified fields.
> +     * We don't know if we are going to be modified after we have
> +     * sent the headers out.
> +     */
> +    apr_table_unset(f->r->headers_out, "ETag");
> +    apr_table_unset(f->r->headers_out, "Last-Modified");
>  
>      rv = send_parsed_content(&b, r, f);

Committed.  Brian and Aaron get nods on the Reviewed by in the commit
log.  I did touch up the comment a bit.

No other committer said anything and this seems reasonable enough to 
me.  If all three of you are wrong, well it's my fault now.  =)  
-- justin


Re: 304's and mod-include --PATCH

Posted by Ian Holsman <ia...@cnet.com>.
here is a patch which does just that.

Index: mod_include.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/filters/mod_include.c,v
retrieving revision 1.146
diff -u -u -r1.146 mod_include.c
--- mod_include.c       2001/09/10 03:58:26     1.146
+++ mod_include.c       2001/09/14 19:34:17
@@ -3081,6 +3081,13 @@
      * the content-length should just be unset.
      */
     apr_table_unset(f->r->headers_out, "Content-Length");
+    /*
+     * Always unset the ETag/Last-Modified fields.
+     * We don't know if we are going to be modified after we have
+     * sent the headers out.
+     */
+    apr_table_unset(f->r->headers_out, "ETag");
+    apr_table_unset(f->r->headers_out, "Last-Modified");
 
     rv = send_parsed_content(&b, r, f);


--
On Fri, 2001-09-14 at 12:33, Aaron Bannert wrote:
> On Fri, Sep 14, 2001 at 12:16:01PM -0700, Brian Pane wrote:
> > Ian Holsman wrote:
> > 
> > >found something interesting.
> > >
> > >a mod-included page (which by it's nature is dynamic)
> > >is getting 304's returned instead of running the page.
> > >
> > >
> > >I'm just wondering if we should remove the 'Last-Modified' and 'ETag'
> > >fields from the header-out response. (like we do with the
> > >content-length)
> > >
> > I suppose the best way to handle Last-Modified for mod_include would
> > be to use the most recent of all of the timestamps of the included
> > files, and suppress the Last-Modified if any included component is
> > dynamic.  But that might be a lot more trouble than it's worth;
> > simply removing Last-Modified and ETag is much easier.
> 
> It is definately more trouble than it's worth, especially when you take
> into account that when you #include virtual/cgi you can't really determine
> if that page is dynamic or not. IIRC, you can also simply include the
> output from exec'd programs (it's been awhile since I've really used
> includes).
> 
> Probably best to just remove the Last-Modified and ETag headers.
> 
> -aaron
-- 
Ian Holsman          IanH@cnet.com
Performance Measurement & Analysis
CNET Networks   -   (415) 364-8608


Re: 304's and mod-include

Posted by Aaron Bannert <aa...@clove.org>.
On Fri, Sep 14, 2001 at 12:16:01PM -0700, Brian Pane wrote:
> Ian Holsman wrote:
> 
> >found something interesting.
> >
> >a mod-included page (which by it's nature is dynamic)
> >is getting 304's returned instead of running the page.
> >
> >
> >I'm just wondering if we should remove the 'Last-Modified' and 'ETag'
> >fields from the header-out response. (like we do with the
> >content-length)
> >
> I suppose the best way to handle Last-Modified for mod_include would
> be to use the most recent of all of the timestamps of the included
> files, and suppress the Last-Modified if any included component is
> dynamic.  But that might be a lot more trouble than it's worth;
> simply removing Last-Modified and ETag is much easier.

It is definately more trouble than it's worth, especially when you take
into account that when you #include virtual/cgi you can't really determine
if that page is dynamic or not. IIRC, you can also simply include the
output from exec'd programs (it's been awhile since I've really used
includes).

Probably best to just remove the Last-Modified and ETag headers.

-aaron


Re: 304's and mod-include

Posted by Brian Pane <bp...@pacbell.net>.
Ian Holsman wrote:

>found something interesting.
>
>a mod-included page (which by it's nature is dynamic)
>is getting 304's returned instead of running the page.
>
>
>I'm just wondering if we should remove the 'Last-Modified' and 'ETag'
>fields from the header-out response. (like we do with the
>content-length)
>
I suppose the best way to handle Last-Modified for mod_include would
be to use the most recent of all of the timestamps of the included
files, and suppress the Last-Modified if any included component is
dynamic.  But that might be a lot more trouble than it's worth;
simply removing Last-Modified and ETag is much easier.

--Brian