Hello,
I am trying to define a cache policy in the following way:
- Cache for one year: all the documents under /appli/production
- Cache for one day: all the documents under /appli/production/*/prompts/*/dynamic/
It works fine on my pc (Apache 2.2.4, Windows 2000): the documents under /dynamic/ are cached for one day and other documents for one year.
But on the server (Apache 2.2.3 Unix), all the documents are cached for one year, even the ones that are under /dynamic/.
The goal of this message is to ask your help to make it work on Apache 2.2.3 (Unix).
Any help will be appreciated!
To do it, I am using the following caching rules in httpd.conf:
<IfModule mod_expires.c>
<LocationMatch
"/appli/production">
ExpiresActive on
ExpiresDefault "access plus 1 year"
</LocationMatch>
<LocationMatch "dynamic">
ExpiresDefault "access plus 1 day"
</LocationMatch>
<LocationMatch "/appli/staging">
ExpiresActive on
ExpiresDefault "access plus 1 second"
</LocationMatch>
<LocationMatch "/appli/index.html">
ExpiresActive on
ExpiresDefault "access plus 1 second"
</LocationMatch>
</IfModule>
Is there any difference between caching rules with Apache 2.2.3 and Apache 2.2.4?
Do you advice to define cache policy in another way?
Below, I have copied the headers
received with my browser. You can see the expiry date is not the same, with the same configuration in httpd.conf document.
____________________________________________________________________
Apache/2.2.4 (Win32) : http://localhost/appli/production/20070115/prompts/en/dynamic/S5.wav GET /appli/production/20070115/prompts/en/dynamic/S5.wav HTTP/1.1 Host: localhost User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr; rv:1.8.0.9) Gecko/20061206
Firefox/1.5.0.9 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,fr;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive HTTP/1.x 200 OK Date: Tue, 16 Jan 2007 10:16:45 GMT Server: Apache/2.2.4 (Win32) Last-Modified: Tue, 02 Jan 2007 10:12:51 GMT Etag: "4aca-7424-f9065868" Accept-Ranges: bytes Content-Length: 29732 Cache-Control: max-age=86400 Expires: Wed, 17 Jan 2007 10:16:45 GMT Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: audio/x-wav ____________________________________________________________________
Apache/2.2.3 (Unix) mod_jk/1.2.19:
http://xxx/appli/production/20070115/prompts/en/dynamic/S5.wav GET /appli/production/20070115/prompts/en/dynamic/S5.wav HTTP/1.1 Host: 16.16.90.44 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,fr;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Proxy-Connection: keep-alive HTTP/1.x 200 OK Proxy-Connection: Keep-Alive Connection:
Keep-Alive Date: Tue, 16 Jan 2007 08:35:56 GMT Server: Apache/2.2.3 (Unix) mod_jk/1.2.19 Last-Modified: Mon, 15 Jan 2007 09:53:53 GMT Etag: "5c581-7424-391d6e40" Accept-Ranges: bytes Content-Length: 29732 Cache-Control: max-age=31536000 Expires: Wed, 16 Jan 2008 08:35:56 GMT Content-Type: audio/x-wav
___________________________________________________________________
Thanks in advance for your help.
If you need more information, please, let me know.
Vincent