httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lichteblau <da...@knowledgetools.de>
Subject Re: mod_cache and Etag headers
Date Tue, 08 Feb 2005 21:46:17 GMT
Justin Erenkrantz <justin@erenkrantz.com> writes:
> > The cached response _body_ is delivered to the client just fine, but
> > together with the 304 response _header_ just received from the upstream
> > server.
> Try trunk now: r152680 is the relevant commit.  Thanks.  -- justin

Did that, but the results are still confusing.

| --- modules/cache/mod_cache.c	(revision 152679)
| +++ modules/cache/mod_cache.c	(revision 152680)
| @@ -532,6 +532,12 @@
|              /* Oh, hey.  It isn't that stale!  Yay! */
|              cache->handle = cache->stale_handle;
|              info = &cache->handle->cache_obj->info;
| +            /* Load in the saved status. */
| +            r->status = info->status;

info->status at this point is zero, because file_cache_recall_mydata()
does not initialize it.

But setting it properly does not help either.  The client gets the bogus
304 no matter what info->status is at this point.

| +            /* The cached response will override our err_headers_out. */
| +            apr_table_clear(r->err_headers_out);
| +            /* Merge in our headers. */
| +            ap_cache_accept_headers(cache->handle, r);

What about r->headers_out here?  Does it have to be cleared, too?

It still contains headers which came just in from the upstream server.
ap_cache_accept_headers() updates these headers, but does not replace
them entirely.

(Not that I have much clue which headers are what here, but I get
"Transfer-Encoding: chunked" in the not-chunked-at-all response, so that
must have come through from the upstream server.)

|              rv = OK;
|          }
|          else {


Thanks again for the help,
David

Mime
View raw message