Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

my setup is as follows:

Browser <=> Ec2 Load Balancer <=> Apache (reverse proxy) <=> Jetty

The Apache and the Jetty are running on the same machine in the Amazon cloud (Debian Lenny, Linux appinstance 2.6.21.7-2.fc8xen-ec2-v1.0 #1 SMP Tue Sep 1 10:25:30 EDT 2009 x86_64 GNU/Linux). The Apache version is 2.2.9. The Jetty version is 6.1.26.

What I'm trying to achieve is basically what Google calls Perfect Caching

My Apache config currently looks like this:

ProxyRequests Off

<Proxy *>
    Order deny,allow
    Allow from all
    SetOutputFilter DEFLATE
</Proxy>

ProxyPass /xxx http://localhost:8080/xxx
ProxyPass /yyy http://localhost:8080/yyy
ProxyPass / http://localhost:9080/

ProxyPreserveHost On

<Files *.nocache.*>
    ExpiresActive  On
    ExpiresDefault "access"
</Files>

<Files *.cache.*>
    ExpiresActive  On
    ExpiresDefault "now plus 1 year"
</Files>

Currently my ExpiresDefault rules are ignored entirely. I googled for quite a while without any luck.

Is it even possible to combine mod_expires with mod_proxy? If yes: What am I doing wrong? Otherwise: Are there any feasible alternatives?

Cheers! Michael

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

use LocationMatch, not Files. Files refers to actual filesystem files, not what looks like a filename int he last component of a URL.

share|improve this answer
    
Works like a charm! Thank you very much! This is what my config looks like now: <LocationMatch .*\.nocache\..*> ExpiresActive On ExpiresDefault "access" </LocationMatch> <LocationMatch .*\.cache\..*> ExpiresActive On ExpiresDefault "now plus 1 year" </LocationMatch> –  Miichal Jul 4 '11 at 8:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.