Re: [RFC] post-cache REQMOD

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Fri, 11 Jul 2014 12:47:55 -0600

On 07/11/2014 11:46 AM, Tsantilas Christos wrote:
> On 07/11/2014 05:47 PM, Alex Rousskov wrote:
>> On 07/11/2014 05:27 AM, Tsantilas Christos wrote:
>>
>>> The PageSpeed example fits better to a post-cache RESPMOD feature.
>>
>> I do not think so. Post-cache RESPMOD does not allow Squid to cache the
>> adapted variants. Please let me know if I missed how post-cache RESPMOD
>> can do that.
>
> I did not read correctly the problem you want to solve. I had in my mind
> a proxy which cache original content and then adapts the cached content
> according client rules.
> But you want to cache adapted content.

Both, actually.

> However still I am not sure I can understand how the post-cache reqmod
> will help.
> Assume the following scenario:
> - Client A requests original web page
> - Client B requests optimized web page (removed spaces and comments)

There are several scenarios and tricks here. I am not going to cover all
of them, but here is one possibility:

* The "A" response gets cached as usual. When it goes through the
pre-cache RESPMOD adaptation service, it gets optimized, and the
optimized variant gets stored in the PageSpeed cache (inside the adapter).

* The "B" request misses the Squid cache (HTTP Vary rules, StoreID,
and/or a pre-cache REQMOD service ensures a miss). That miss request
reaches the post-cache REQMOD service. The service finds a matching
optimized response in the PageSpeed cache and satisfies the miss request
with that. Squid caches the service response.

* The Squid cache now contains both response variants. Any future
request for the original or optimized page will be served from the Squid
cache.

Again, this is just one scenario/possibility. A post-cache REQMOD
service can be used for many other things, of course. It allows to limit
adaptation to misses and to cache adapted miss responses without going
all the way to the origin server.

In fact, one could use it to implement a whole web server backed by a
Squid cache! The existing pre-cache REQMOD service can also be used as a
web server replacement but it cannot get advantage of the Squid cache.

Hope this clarifies,

Alex.
Received on Fri Jul 11 2014 - 18:48:11 MDT

This archive was generated by hypermail 2.2.0 : Sat Jul 12 2014 - 12:00:13 MDT