Re: ICAP vectoring points

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Wed, 28 Nov 2012 09:19:54 -0700

On 11/28/2012 04:16 AM, Steve Hill wrote:

> I have a requirement for a respmod_postcache vectoring point (ICAP
> server is between the cache and the client and intercepts responses).
> I've not done a lot of work on the Squid internals, so would anyone be
> able to give me some pointers on what is involved in implementing this
> and where to start looking? Am I correct in thinking that since this
> hasn't been implemented yet, it is reasonably non-trivial?

Hi Steve,

    Yes, it is both very far from trivial and, in most cases, avoidable
by redesigning the adaptation approach itself. I have seen many use
cases that started with a post-cache requirement, but were successfully
massaged into avoiding one. FWIW, none of the competing proxies support
post-cache ICAP adaptations AFAIK.

IMO, post-cache adaptations support in Squid should be welcomed, but
properly adding it to the current client-side code mess would be
difficult. A better plan may be to restructure and streamline the
client-side code first.

BTW, adaptation needs drove a lot of server-side code polishing as well,
but it took many [non-consecutive] months, and the server-side code was
arguably in a better shape to start with.

The existing adaptation code should work well with all four standard
vectoring points. It is the vectoring point code itself that presents a
challenge here.

If you are looking for starting pointers, search for Adaptation
namespace use in Server.cc and client_side*.cc. There are not so many of
them, but do not be deceived by the apparent simplicity of that code:
The difficulty is hidden in the asynchronous interaction between
adaptation buffers/streams/decisions and client/server side
buffers/streams/decisions. On the client side, you will probably need to
inject post-cache adaptation when the store_client is receiving a
response (see StoreClient.h).

Please make sure the new code is agnostic to the ICAP/eCAP difference,
just like the existing adaptation code. If you find yourself accessing
ICAP-specific code for post-cache adaptation needs, you are probably
doing something wrong.

HTH,

Alex.
Received on Wed Nov 28 2012 - 16:20:00 MST

This archive was generated by hypermail 2.2.0 : Wed Nov 28 2012 - 12:00:08 MST