e-cap service only seems to work on some pages

Asked by Luis Miguel Silva on 2015-02-12

My ecap service only seems to work on some pages and I don't really know why?

Here's what I did to test it:
- I compiled squid 3.4.9 with ecap support
- Compiled e-cap version 0.2 and the sample adapters (v0.2.1)
- I've added the following configuration to my squid.conf:
loadable_modules /usr/local/lib/ecap_adapter_modifying.so
ecap_enable on
ecap_service ecapModifier respmod_precache 0 ecap://e-cap.org/ecap/services/sample/modifying victim=professor replacement=teacher
adaptation_access ecapModifier allow all

Unfortunately, the modifying adapter only seems to work some times (e.g. for instance, it works on this one [http://www.pedagua.com/lmsilva/] but not on this one [http://en.wikipedia.org/wiki/Professor]).

Why is this happening? Am I doing something wrong?

Also, I tried to use the modifying adapter with a replacement-src and it didn't work at all.

Thank you,
Luis

Question information

Language:
English Edit question
Status:
Answered
For:
eCAP Edit question
Assignee:
No assignee Edit question
Last query:
2015-02-12
Last reply:
2015-02-13
Alex Rousskov (rousskov) said : #1

The modifying adapter sample is a very simple adapter that does not support decoding of gzipped content. Perhaps the "pages" that do not work for you are delivered to Squid compressed?

You can validate the above theory by configuring Squid to delete the Accept-Encoding request header when forwarding requests (not recommended for production use!). See request_header_access in squid.conf.documented or contact the Squid project for help with that directive.

Another validation method is to look at the response headers received by Squid. If the content is compressed, the sample adapter will not be able to modify it successfully.

I will try that, thank you!

...although I was able to get it to work on one page once and then it stopped working so I somewhat doubt this is being caused because content is being compressed.

How can I take a look at the response headers received by squid? Is there a way to log them?

Alex Rousskov (rousskov) said : #3

Yes, you can log headers by setting debug_options in squid.conf to ALL,2 (or higher). You can also use wireshark or a similar tool to look at the headers.

Please direct future Squid-specific questions to Squid support channels.

Can you help with this problem?

Provide an answer of your own, or ask Luis Miguel Silva for more information if necessary.

To post a message you must log in.