Re: range request cache

From: Volodymyr Kostyrko <c.kworr_at_gmail.com>
Date: Fri, 02 Mar 2012 17:08:35 +0200

Alex Rousskov wrote:
> On 02/21/2012 05:09 PM, Zhu, Shan wrote:
>> I have an urgent need for caching requested ranges so I want to do a quick "hack" on this topic before the new feature becomes available.
>>
>> What I want to achieve is for Squid to cache a range request without pre-fetching and caching the whole object, so that if the cached range is requested again it can be served from the cache.
>>
>> What I want to do is to change the URL with range request into a unique file name, and once the response is received from the back-end server, the response can be cached as a single object.
>> The workflow should be like this,
>>
>> (1) Change URL with range request into something like: "[original URL]_[range start]_[range end]", internally to Squid only.
>>
>> (2) Squid checks cache to see if it is cached. If yes, Squid responds to the client with the cached object. If no, go to Step 3.
>>
>> (3) When it is a cache miss in Step 2, Squid forwards the original URL to the back-end server, with range request, as normal. (Not to pre-fetch of = the whole object file.)
>>
>> (4) Squid receives the response from back-end server, for the requested range only, recognizes it as the response corresponding to the changed URL = "[original URL]_[range start]_[range end]".
>>
>> (5) Squid caches the range according to the changed URL "[original URL]_[range start]_[range end]", like a single object file.
>>
>> (6) Squid responds to the client for the URL with range request, as normal.
>>
>> Here I may have simplified the problem and omitted the time-stamp issue, etc.
>>
>> Is this doable? How difficult would it be? Can I get any suggestion on how to proceed? I am starting from scratch on the source code change.
>
>
> Adding support for range caching is doable, of course. It is a difficult
> project though, even if you limit that support to the absolute minimum.

Not so difficult as it seems: http://code.google.com/p/samesite/

-- 
Sphinx of black quartz judge my vow.
Received on Sat Mar 03 2012 - 02:38:00 MST

This archive was generated by hypermail 2.2.0 : Sat Mar 03 2012 - 12:00:03 MST