Re: trying cache post request for some sites failed

From: johan firdianto <johanfirdi_at_gmail.com>
Date: Mon, 22 Jun 2009 19:46:35 +0700

On Mon, Jun 22, 2009 at 7:26 PM, Henrik
Nordstrom<henrik_at_henriknordstrom.net> wrote:
> mån 2009-06-22 klockan 12:03 +0700 skrev johan firdianto:
>> I already add refresh pattern
>> refresh_pattern -i xxxxx 999888 100% 999999 ignore-no-cache
>> ignore-reload override-expire override-lastmod reload-into-ims
>> this could help to force cache the object ?
>
> Squid never caches POST responses. This due to some ambiguity on what
> caching of POST responses really means, and the fact that most POST
> responses are very dependent on the POST:ed data.

yes, absolutely.
In a file sharing sites, in order to download a file they use POST method.
after i analyze their uri of POST is unique enough. So whatever next
request post method, as long as uri of post method is same and
different data that POST:ed will return the same file/object.
So my aim is to cache the response of POST, after that I pull the
object out of swap cache (using curl or wget), and put in the other
directory.
And next time, I use url rewrite to trap the post method in case the
same request comes again.
I know, this is will be odd when applied to all sites.
many mp3 song that downloaded many times from a file sharing site, and
can't be cached because using post method. this site has ranks 25 in
traffic (according alexa.com).
Could u give me idea, what should i do ?

Regards,

Johan

> In HTTP terms caching of a POST response actually means that it will be
> returned as a cache hit on a later GET for the same URL. But this is a
> bit counter-intuitive to most people and I guess not what you are
> looking for..
>
> Regards
> Henrik
>
>
Received on Mon Jun 22 2009 - 12:46:37 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 22 2009 - 12:00:04 MDT