Search squid archive

Re: cookie value & squid cache

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

 



On 3/01/2012 4:44 a.m., karj wrote:
Dear all,
We are using squid 2.7.STABLE9
And
We have a generic cookie system, which, essentially shows a
person's country location for displaying the weather inside  a web page.
The value of the cookie 99% equals with A,
if someone changes his location and wants to display a different city
the value of the cookie will change accordingly, to B, C , D etc.
Is there a way to cache different responses of the origin according to the
cookie value.

No. Proxies do not have access to the internals of Cookies. Varying the content based on that makes it uncacheable.

Why base this on a Cookie though? It would be far more HTTP friendly to have each city at a different URL and the page contain a script that pulls a city URL from the server directly into the page. You can still store the city detail in a cookie and access that info from the script.

If not,
can we cache the web page when the cookie value is A
and send all other request to origin web servers i.e. when the cookie values
are B or C or D (there are almost 200 values for the cookie).

Cookie values are erased from cached content when delivered. For security reasons.


The url is somethening like.
weather.example.com/ajax.aspx?m=Weather.DefaultCities

Thanks in advance


Amos


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

  Powered by Linux