httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hansjoerg Pehofer <>
Subject Re: mod_cache caching the 301 Moved Permanently
Date Thu, 07 Jul 2005 14:53:47 GMT

it has been some time since the original thread.
This is in reply to [1].

Sander Striker wrote:
>> wrote:
>> The problem seems to be, that the proxied backend server that is
>> cached via mod_disk_cache originally
>> delivers HTTP status 301 and the Location
>>, but once cached
>> mod_disk_cache delivers HTTP status 200 instead of 301 (but
>> correctly redelivering the Location header).
>> I have not proved this for myself so far, but this seems the problem
>> to me.

>This wouldn't surprise me one bit.  The 2.1 branch has seen quite a
>bit of churn in this

>Any chance you could give 2.1 a go and see if that works correctly?

It is the same problem as described in issue 32226 [2].
Unfortunately, the described behavior is still present in both httpd
2.0.54 and 2.1.6-alpha with mod_disk_cache active. I can not reproduce 
it with 2.1.6-alpha and mod_mem_cache.

Tested with the following setup:

 httpd 2.1.6-alpha on, cache, disk_cache and proxy* modules
 loaded, out of the box httpd.conf plus:

 CacheRoot /cache/alpha
 CacheEnable disk /
 CacheDirLevels 1
 CacheDirLength 2

 ProxyPass        /  http://backend.tld/
 ProxyPassReverse /  http://backend.tld/

 Apache 1.3, a file cachetest/gonk/index.html relative to DocumentRoot.

A first request to the Proxy (GET /cachetest/gonk) correctly responds in
301ing to /cachetest/gonk/ first -- and then getting the index document.
There are 2 .data/.header couples in the cachedir at this point (the
redirect-message and the index document ).

A second request with a second client, or if the browser's cache has 
been cleared, returns the cached "Moved Permanently" message with 
status 200.  This message contains a link in the backend's view of the
URLs (as discussed in the original thread).

The /cache/alpha/Kx/lZGs_@eMqfu9BZQZTN4g.header Cache File contains:

Thu, 07 Jul 2005 12:34 :21 GMT
  Server: Apache
  Content-Type: text/html; charset=iso-8859-1
  Expires: Thu, 07 Jul 2005 12:35:21 GMT

  User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8)
  Gecko/20050513 Debian/1.7.8-1
  Accept-Language: de-at,de;q=0.8,en;q=0.5,it;q=0.3
  Accept-Encoding: gzip,deflate
  Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
  Max-Forwards: 10

[3], which is an attachment to [2] contains a fragment that keeps 
mod_cache.c from handling redirects at all -- if i understood it right,
however it works for us.  This is probably only the second best i
approach, since 301 is cacheable.




IT Services                University of Innsbruck    
CFB4 D6E7 33F4 34C0 18B9  6661 E355 4337 3F8B D9C2

View raw message