You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Pane <bp...@pacbell.net> on 2001/12/06 03:57:03 UTC

last-modified and subrequests

For mod_include subrequests, the default_handler() adds a
Last-Modified field to the request_rec.  This is an expensive
operation (due to the date/time formatting required), so I'd
like to eliminate it.

Is it safe to suppress the setting of Last-Modified in
default_handler() when r->main!=NULL?  If there are any
cases where we *would* need to set Last-Modified on a
subrequest, is there a heuristic that could be used to
distinguish them from the mod_include case?

Thanks,
--Brian



Re: last-modified and subrequests

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
On Wed, Dec 05, 2001 at 06:57:03PM -0800, Brian Pane wrote:
> For mod_include subrequests, the default_handler() adds a
> Last-Modified field to the request_rec.  This is an expensive
> operation (due to the date/time formatting required), so I'd
> like to eliminate it.

Setting r->mtime should be sufficient to allow the parent to pick
up that value if it needs it, but a different mechanism altogether
is needed if the subrequest is generated within a filter.  2.1, I guess.

> Is it safe to suppress the setting of Last-Modified in
> default_handler() when r->main!=NULL?  If there are any
> cases where we *would* need to set Last-Modified on a
> subrequest, is there a heuristic that could be used to
> distinguish them from the mod_include case?

Internal redirects have r->main==NULL, right?  I think it is okay not
to set the header field in a subrequest, provided that the parent has
some other way to get the mtime.  Eventually, though, the mtime will
have to be passed through the filters as metadata, but that can just
be a raw apr_time_t until it gets to the HTTP filter.

....Roy