[squid-users] Re: How to ignore query terms for store key?

From: Guy Bashkansky <guybas_at_gmail.com>
Date: Tue, 7 Sep 2010 18:59:16 -0700

Thanks, storeurl_rewrite in Squid 2.7 looks like the right solution.

But when I try to use it to strip query, Squid does not respond:

/usr/local/squid/etc/squid.conf
    storeurl_access allow all # just for the test, will narrow down later
    storeurl_rewrite_program /usr/local/squid/bin/strip-query.pl

/usr/local/squid/bin/strip-query.pl
    #!/usr/local/bin/perl -Tw
    $| = 1; while(<>) { chomp; s/\?\S*//; print; } ### my strip query test

$ /usr/local/squid/sbin/squid -k reconfigure -f /usr/local/squid/etc/squid.conf
    ...2010/08/09 15:07:10| helperOpenServers: Starting 5
'strip-query.pl' processes...

$ wget ... '<origin_url>'
    ...Proxy request sent, awaiting response... ### gets stuck

(Without storeurl_rewrite wget works OK)

What am I missing?

2010/9/7 Henrik Nordström <henrik_at_henriknordstrom.net>
>
> fre 2010-09-03 klockan 18:03 -0700 skrev Guy Bashkansky:
> > Is there a way to ignore URI query terms when forming store keys?
> > Maybe some rule or extension?
>
> http://wiki.squid-cache.org/Features/StoreUrlRewrite
>
> needs to be implemented for Squid-3 as well.. currently a Squid-2 only
> feature.
>
> Regards
> Henrik
>

On Fri, Sep 3, 2010 at 8:09 PM, Amos Jeffries <squid3_at_treenet.co.nz> wrote:
> Guy Bashkansky wrote:
>>
>> Is there a way to ignore URI query terms when forming store keys?
>> Maybe some rule or extension?
>>
>> In the Squid code it could look something like:
>> { char *p = strchr(uri, '?'); if (p) *p = '\0'; }
>>
>> But the only code like this deals with strip_query_terms,
>> which only affects logging, not storing.
>
> First, please answer: Why? what possible problem could require you to do
> this massive abuse of the web?
>
> storeurl_rewrite
>
> Be EXTREMELY careful about what you re-write. A good understanding of how
> the re-written website operates is needed. Along with complete trust that
> the website will not alter its design (or layout) in any way for the
> lifetime of your config.
>
> Amos
> --
> Please be using
>  Current Stable Squid 2.7.STABLE9 or 3.1.7
>  Beta testers wanted for 3.2.0.2
>
Received on Wed Sep 08 2010 - 02:05:22 MDT

This archive was generated by hypermail 2.2.0 : Thu Sep 09 2010 - 12:00:02 MDT