httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Axel-St├ęphane SMORGRAV <Axel-Stephane.SMORG...@europe.adp.com>
Subject RE: [users@httpd] mod_cache: CacheDefaultExpire is ignored?
Date Wed, 08 Mar 2006 16:45:51 GMT
The problem is that the response contains no cache validator: no Last-Modified, no E-Tag. 
If it contains no cache validator, it must contain an explicit expiry date in order to be
cacheable. Look at sections 13.3 and 13.4 of RFC 2616.

Your problem is typical of files generated by a servlet, or more generally by an application
and not served by a http server or the file servlet of an application server.

You can have the application add a cache validator to the response, or you can use ExpiresActive/ExpiresByType/ExpiresDefault
to have your reverse proxy add the Expires header. The problem is that I believe that the
Expires header in that case will be added after mod_cache has decided to decline to cache,
but you can try it anyway.

-ascs

-----Original Message-----
From: Frans Knibbe [mailto:frans@geodan.nl] 
Sent: Wednesday, March 08, 2006 3:58 PM
To: users@httpd.apache.org
Subject: [users@httpd] mod_cache: CacheDefaultExpire is ignored?

Hello,

I use apache 2.0.55 on Windows and I am experiencing a problem using mod_cache.

It is my intention to use a memory cache for images produced by a CGI program. Here is the
relevant bit of httpd.conf:

<IfModule mod_cache.c>
  LoadModule mem_cache_module modules/mod_mem_cache.so
  <IfModule mod_mem_cache.c>
    CacheDefaultExpire 86400
    CacheEnable mem /
    MCacheSize 4096
    MCacheMaxObjectCount 10000
    MCacheMinObjectSize 1
    MCacheMaxObjectSize 104857600
    MCacheMaxStreamingBuffer 104857600
    MCacheSize 409600
  </IfModule>
</IfModule>

If I let Apache log debug information, I can see that caching is active. 
Some caching takes place, but not the images I want cached. In that case,  something like
this is reported:

[Wed Mar 08 14:09:11 2006] [debug] mod_cache.c(446): cache: <request> not cached. Reason:
Query string present but no expires header

There is no expiration time in the header, that is true, but shouldn't CacheDefaultExpire
be used in that case? In the documentation it says: 
"The CacheDefaultExpire directive specifies a default time, in seconds, to cache a document
if neither an expiry date nor last-modified date are provided with the document". So if there
is no expires header the expiry time should be set to one day (86400 seconds) in this case,
right?

Am I overlooking something? How can I get caching to work?

Thanks in advance,

Frans Knibbe




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message