RE: [users@httpd] mod_cache and conditional disabling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK What about this, at the expense of an additional GET :

<VirtualHost www.foo.bar>
   RewriteCond %{HTTP_COOKIE}	MYCOOKIE
   RewriteRule ^(.*)$ http://cache.foo.bar$1 [P]

   ProxyPassReverse  / http://cache.foo.bar/

   ProxyPass / http://backend.foo.bar/ 
   ProxyPassReverse  / http://backend.foo.bar/
</VirtualHost>

<VirtualHost cache.foo.bar>
   ProxyPass / http://backend.foo.bar/ 
   ProxyPassReverse  / http://backend.foo.bar/

   CacheEnable /
</VirtualHost>
 

-----Original Message-----
From: Colm MacCarthaigh [mailto:colm@xxxxxxxxxx] 
Sent: Thursday, August 25, 2005 10:35 AM
To: users@xxxxxxxxxxxxxxxx
Subject: Re: [users@httpd] mod_cache and conditional disabling

On Thu, Aug 25, 2005 at 10:30:19AM +0200, Axel-Stéphane  SMORGRAV wrote:
> It is possible by doing a bit of rewriting and tweaking of URLs.
> 
> Here's the general idea:
> 
> RewriteCond %{HTTP_COOKIE}	MYCOOKIE
> RewriteRule ^(.*)$ /DONTCACHE$1
> 
> ProxyPass /DONTCACHE http://backend.foo.bar/ ProxyPassReverse  
> /DONTCACHE http://backend.foo.bar/
> 
> CacheDisable /DONTCACHE
> 
> or something like that.

I don't think that will work reliably. Although it will prevent requests with the cookie set from being cached, it will not prevent responses for non-cookie users being served to cookie users. This is because mod_cache runs as a quick-handler, before mod_rewrite has had a chance to run.

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@xxxxxxxxxx

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux