RE: [squid-users] ignore question mark in url

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Mon, 2 Feb 2009 16:17:25 +1300 (NZDT)

> So lets say you have an origin server that is smart enough to redirect to
> the correct URL always.
>
> For example, identical pages:
> 1. mydomain.com/blah?a=b&c=d
> 2. mydomain.com/blah?a=b&c=d&button.x=10
> 3. mydomain.com/blah?c=d&a=b
>
> Are all the same page, but the "correct" URL is 1.
>
> The origin server redirects URLs 2 and 3 to URL 1 using HTTP 301 response.
>
> Then it should be fairly safe to use the entire URL with the query string
> as
> a cache key. When users access URL 2 a few times, then Squid can go to the
> origin server only once, and afterwards return 301 response from cache.
>
> Is this a good assumption?

Hmm, I think thats the best way to do it yes.

>
> Do I need to add Expires header and max-age to the 301 response to make
> this
> work?

Yes they may be needed to make the 301 cachable for longer periods than
the underlying page. Without, squid is left with estimations that do not
always do what you want.

Amos

>
> E
>
> -----Original Message-----
> From: Amos Jeffries [mailto:squid3_at_treenet.co.nz]
> Sent: Sunday, February 01, 2009 4:58 PM
> To: Maoz
> Cc: Amos Jeffries; squid-users
> Subject: Re: [squid-users] ignore question mark in url
>
>> been there, done that..... didn't find any relevant information there.
>>
>>
>> On Sun, 2009-02-01 at 23:31 +1300, Amos Jeffries wrote:
>>> Maoz wrote:
>>> > hello,
>>> > how can I ignore the question mark in url
>>> > I'll explain:
>>> > Treat the url until the question mark as object.
>>> >
>>> > www.domain.com/index.jsp?aaa=1
>>> >
>>> > will be the same object as:
>>> >
>>> > www.domain.com/index.jsp?aaa=10
>>> >
>>> > and
>>> >
>>> > www.domain.com/index.jsp?aaa=2&ggg=3
>>> >
>>> > thanks
>>> >
>>>
>>> http://wiki.squid-cache.org/ConfigExamples/DynamicContent
>>>
>>> Amos
>>
>
> Ah, sorry, now that I've woken up and re-read your request I see you were
> asking something different to what I though.
>
> You want the experimental storeurl controls from Squid-2.7.
> http://www.squid-cache.org/Versions/v2/2.7/cfgman/storeurl_rewrite_program.h
> tml
>
>
> Note that duplicating dynamic URLs like that is very dangerous procedure:
> - for web providers it drops them into the nasty bandwidth wasting hole
> youtube is currently in.
> - for cache operators it drops you into the liability of getting it right
> and forever having to check its still right. Big issues when it goes even
> slightly wrong.
>
> Amos
>
>
>
>
Received on Mon Feb 02 2009 - 03:17:40 MST

This archive was generated by hypermail 2.2.0 : Mon Feb 02 2009 - 12:00:03 MST