Search squid archive

RE: GET/POST caching

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

 



> -----Original Message-----
> From: Stefan Palme [mailto:kleiner@xxxxxxxxxxxxxxx]
> Sent: Monday, December 05, 2005 5:19 AM
> To: squid-users@xxxxxxxxxxxxxxx
> Subject:  GET/POST caching
> 
> 
> 
> Hello,
> 
> does squid distinguish between GET and POST URLs? I have an HTML form
> (as part of a CMS) that will be first requested by "GET /form.html".
> When the user submits the form, a "POST /form.html" will be made,
> including the form data in the body of the request.
> 
> I want to "GET" request to be cached, because the result is always the
> same (an empty form), but I want the response to the "POST" request
> not to be cached.
> 
> Is it enough to put a
> 
>   acl POSTs method POST
>   no_cache deny POSTs
> 
> in squid.conf?
> 
> I guess, the first GET request will made squid cache "/form.html",
> and the next POST will find the cached object. The no_cache directive
> just says not to cache the response from the origin server, but I
> guess it does not prevent squid from looking in the cache if there
> is already a "/form.html"...
> 
> regards
> -stefan-
> 

According to the HTTP RFC (http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5) "Responses to [the POST] method are not cacheable, unless the response includes appropriate Cache-Control or Expires header fields."

The developers put a lot of effort in to assuring that Squid is RFC compliant, so your example acl won't hurt anything, but won't help either.

Chris


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

  Powered by Linux