httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Covener" <cove...@gmail.com>
Subject Re: [users@httpd] Combining caching and rewrites
Date Wed, 26 Nov 2008 01:58:10 GMT
On Tue, Nov 25, 2008 at 8:20 PM, wi <icebattle@gmail.com> wrote:
> Hi All
>
> I have a response from an expensive backend service that I would like
> to cache. We already do some caching of static content, and that works
> fine. However, the response that I want to cache is normally generated
> by a rewrite (the last three lines below). So, if I add some caching
> directives, I get the following. Is this likely to work? How does the
> result of the rewrite wind up in the cache?
>
> (What I'm probably asking is how the response is handled after generation...)
>
>   <IfModule mod_disk_cache.c>
>      CacheIgnoreCacheControl On
>      CacheDefaultExpire 300
>      CacheIgnoreNoLastMod On
>      CacheStoreNoStore On
>      CacheStorePrivate On
>      CacheRoot /caches/tmp/dbgen
>      CacheEnable disk /expstuff
>  </IfModule>
>  RewriteCond %{REQUEST_METHOD} GET
>  RewriteCond %{REQUEST_URI} ^/expstuff
>  RewriteRule ^/(.*) http://xx.xx.xx.xx:7777/$1 [P,NE,L]

Try it and see, but my guess would be that Apache remembers content
keyeed to "/expstuff/foo" as it gets written the first time -- the
next time through, the Rewrites never get a chance to do anything.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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