httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Verbeeck <>
Subject [PATCH] caching and query strings
Date Thu, 12 Sep 2002 12:32:20 GMT

Some of our QA people discovered a problem when performing request
with a query string on a mod_cache enabled Apache 2.0.40 setup.

  Request 1:  /test.html?x=1&y=3
  Request 2:  /test.html?x=2&y=4

Performing request 1 triggers mod_cache to store the response in its
cache.  When performing request 2, the data from request 1 is returned
because mod_cache only uses the URI when generating a cache key.  The 
patch that is attached will fix this.

According to RFC 2616 (HTTP/1.1) paragraph 13.9:

  "...: since some applications have traditionally used GETs
   and HEADs with query URLs (those containing a "?" in the 
   rel_path part) to perform operations with significant side
   effects, caches MUST NOT treat responses to such URIs as 
   fresh unless the server provides an explicit expiration 

The fix does the following:
1. decline caching when there is a query string present and
   no 'Expires' header is found (mod_cache.c)
2. use 'URI' + '?' + 'query string' has the hash key instead
   of only the URI (cache_storage.c)

ir. Kris Verbeeck
Development Engineer

Ubizen - Ubicenter - Philipssite 5 - 3001 Leuven - Belgium
T:  +32 16 28 70 64
F:  +32 16 28 70 77

Ubizen - We Secure e-business -

View raw message