[squid-users] Caching http google deb files

Alex Rousskov rousskov at measurement-factory.com
Fri Oct 7 14:46:37 UTC 2016


On 10/07/2016 03:26 AM, Hardik Dangar wrote:
> 2) I want to build a module which will first handle Vary: * requests and
> convert it into Vary: Accept-Encoding or something similar but only for
> the ACL's specified by cache administrator.

If you want to convert/change the Vary response header, you can:

* write an ICAP RESPMOD service
* write an eCAP RESPMOD adapter
* add reply_header_replace code similar to request_header_replace code
  or, better, revamp related directives to make header replacing easier.

See http://wiki.squid-cache.org/SquidFaq/ContentAdaptation

As I tried to indicate earlier, a better solution would be not to
replace the Vary header (because that affects everybody receiving it
after Squid) but to make Vary interpretation configurable while still
forwarding the original Vary header. That requires more development.


If you want to minimize [C++] development, you could use c-icap or a
even a temporary ICAP server script and, instead of replacing Vary, add
an X-Squid-Vary header with the right value. After that, you can modify
Squid to honor X-Squid-Vary (instead of Vary) if it is present. Look for
ACCELERATOR_VARY for similar (but different?) code. Such code may not be
officially accepted, but it can work as a proof of concept.


> Basically, I need to know how to debug line by line source for squid.
> Right now my method of testing involves building squid and adding debug
> lines and its very slow process as it takes time every time. Can you
> help me with this ? is there a way i could send a request directly to
> squid source file i.e debug source code line by line ? If so what are
> the tools required and how to set it up ?
> 
> Again, I am sorry if i am asking too much but my C experience is very
> limited and i feel like i am asking very naive questions but these are
> very difficult for me at this stage and i really appreciate all of the
> squid dev teams who is been answering all of my questions.

Sorry, I personally cannot help you with that endeavor right now. This
may sound harsh, but seeing many folks with a lot more C++ skills fail
before you, I have to recommend staying away from non-trivial code
changes given your current skill level. It is possible to learn [C++ and
proxy] development on-the-fly, but Squid is just the wrong product for
doing that IMHO.


Good luck,

Alex.



More information about the squid-users mailing list