Search squid archive

RE: ignore question mark in url

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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@xxxxxxxxxxxxx]
> Sent: Sunday, February 01, 2009 4:58 PM
> To: Maoz
> Cc: Amos Jeffries; squid-users
> Subject: Re:  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
>
>
>
>



[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux