httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve McInerney" <st...@stedee.id.au>
Subject RE: [users@httpd] mod_cache and conditional disabling
Date Thu, 25 Aug 2005 22:05:55 GMT
Indeed! My profound and effusive thanks!!!

I've done some preliminary testing and apart from some minor niggles with
site specific stuff, it all works like a champ. [1]
Still need to go thru formal testing etc etc etc to completely verify, but
the preliminaries are very promising.

Those remaining niggles should be fairly easy to solve from here now I
have a way forward.


Colm's suggestion of using Vary was where I was about to start. Could have
been painful so I wasn't looking forward to it. Due to a couple of
factors, we are trying to avoid spending too much time doing code changes.
So a server based solution is ideal.

The additional GET is, in the overall scheme of things, trivial. Initial
testing via siege suggests a complete site speed/throughput improvement of
over 100x. I'm not going to worry about that additional GET. :-)


If I may be indulged, I'd like to explain the solution to bed it in my own
mind and help others that follow later. Feel free to correct etc.


Problem: Need to cache most traffic; Need to *not* cache remaining traffic
identified via Cookie. All URL's are identical. Need caching as a short
term performance improvment (so we have time to do a major code
cleanup/upgrade).


*  Create Two Virtual servers. The primary/original address (www.foo.bar)
and a new one to deal with any and all caching (cache.foo.bar)

*  We still have a backend server that actually does all the slow work
(backend.foo.bar)

*  Within www.foo.bar's virtual config we have two decision/config branches.
   i.  Using a Conditional rewrite, look for the identifying Cookie, if
NOT found, then using a rewrite rule, send the request via proxy via
the cache.foo.bar virtual server. Don't forget the ProxyPassReverse.
[3]
   ii. We are at this point if we have not matched (i); thus we *DO* have
a matching Cookie and can instead proxy direct to the backend server,
avoiding the cache server.
*  Configure the Cache virtual server to:
   a.  Cache
   b.  Proxy requests to the backend server. This particular (as in (b)
alone) config is identical to (ii) above.


Cheers, and again my thanks!


- Steve


[1] NB. When using rewrite rules if *really* helps if you make sure that
the rewrite engine is on. Doh. [2]
[2] Too early in the morning and barely started on my coffee.
[3] Appears to be an additional key missing line in my solo attempt using
rewrites.


On Thu, August 25, 2005 22:07, Axel-Stéphane  SMORGRAV said:
> Uh, yeah. T'was the other way around.
>
> Well: Houston, we've got a solution !
>
> -ascs
>
> -----Original Message-----
> From: Colm MacCarthaigh [mailto:colm@stdlib.net]
> Sent: Thursday, August 25, 2005 2:04 PM
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] mod_cache and conditional disabling
>
> On Thu, Aug 25, 2005 at 01:56:07PM +0200, Axel-Stéphane  SMORGRAV wrote:
>> 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>
>
> No, that still won't work, but almost :) If you have;
>
>     RewriteCond %{HTTP_COOKIE}	!MYCOOKIE
>
> The above will work, I think.
>
> --
> Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net
>
> ---------------------------------------------------------------------
> 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
>
>
>
>


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