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:[EMAIL PROTECTED] 
Sent: Wednesday, March 08, 2006 3:58 PM
To: users@httpd.apache.org
Subject: [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to