(not) caching with mod_expires



Hi all,

This one is bit techy so please bear with me....

We have to use apache 1.3 (as supplied by Oracle). I'm currently
trying to get our content to cache nicely at the browser. While I can
get the static content into the cache initially, the problem occurs
when the caching info expires - subsequently *every* reference to the
URL causes a conditional request and a 304 response. Running over
HTTPS this is a huge overhead. (I believe it should be possible to, in
theory to supply revised caching info with a 304 response - but in
practice I've not been able to work out how).

With a bit of experimentation I found that it was possible to get the
browser to perform an unconditional request on expiry by omitting the
'Last-modified' header from the original response - but 'Header unset
Last-modified' doesn't work on 1.3 (works OK on 2.0). If we had 2.0,
we could also remove the conditional parts of the request - IIRC there
is a 3rd party module to do this in 1.3, but that causes us warranty
problems.

(the previous paragraph is only partially relevant to my current
problem - but if anyone knows how to solve it, it makes the main issue
in this posting moot)

As an interim measure I've given up on dealing with the expired
scenario and I'm just trying to get it working first time around,
however mod_expires is setting a cache-control: max-age=... header
(this does NOT seem to be documented but confirmed from the source
code), which in combination with an old file stamp means that the
content is stale as soon as it gets to the browser:

HTTP/1.1 200 OK
Cache-Control: max-age=604800
Expires: Wed, 31 Oct 2007 08:43:42 GMT
Content-Type: image/gif
Last-Modified: Tue, 28 Mar 2006 15:18:37 GMT
Connection: Close
Content-Length: 146
Date: Wed, 24 Oct 2007 08:43:42 GMT
Accept-Ranges: bytes

(refreshing this causes a conditional GET and a 304 response)

Unfortunately it seems that mod_headers also fails to remove the
'cache-control' header (or does it before mod_expires inserts it).

Other than:
1) updating all the file mtimes
2) upgrading to 2.0
Is there any way to get around this?

TIA

C.

.



Relevant Pages

  • Re: Request for suggestions re: architecture of IntraNet/Socket app[s]
    ... Your Ajax routine could be used to call an ISAPI dll from the browser, ... Here is the Simple Java Servlet ... @param request servlet request ... @param response servlet response ...
    (borland.public.delphi.non-technical)
  • Re: HTTP header processing sequence
    ... when the browser gets the initial index.html page (or ... somehow matches each response with the corresponding request. ... more about how the browser match up all the responses send from the server ...
    (microsoft.public.win32.programmer.networks)
  • Re: HTTP header processing sequence
    ... HTTPWatch is doing that, not the browser. ... The browser issues a GET waits for response (no more GETs till it gets that ... server from the client. ... Initially it sends the request for the html ...
    (microsoft.public.win32.programmer.networks)
  • Re: Custom 401 page problems
    ... Since you configured IIS to send a staic for this ... Now, a 401 response comes back to the client, and the entite body is the ... it is going to make a new request for this resource ... What request do you think the browser makes to fetch the 401.gif ??? ...
    (microsoft.public.inetserver.iis)
  • Re: After gmail logs out, cannot go back through browser back button
    ... Pragma: no-cache ... Expires: Fri, ... Then when you click back button browser will request the page again and it's up to your code to check if user is not logged in and redirect to login page. ...
    (microsoft.public.dotnet.framework.aspnet)