cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Pragma: no-cache

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 11 Nov 2008 17:09:34 -0800

On Tue, Nov 11, 2008 at 06:27:53PM -0500, Alexander Agranovsky wrote:
> I've noticed, that when the request is sent through a proxy, "Pragma:
> no-cache" header is appended even when application did not request it.
>
> I've tracked it to the following code in http.c:
>
> http->p_pragma =
> (!checkheaders(data, "Pragma:") &&
> (conn->bits.httpproxy && !conn->bits.tunnel_proxy) )?
> "Pragma: no-cache\r\n":NULL;
>
> Isn't there bug in it? E.g. I'd see how we want to turn caching off when
> tunneling through a proxy, but if the tunneling is off, and proxy is used
> -- why set "Pragma: no-cache" by default?
>
> Or did I miss something? Is there any way to not introduce this header
> without tunneling?

I've wondered why Pragma: no-cache is the default at all. IMHO, if the
application wants specific caching behaviour, it can ask for it itself.
Turning off caching can result in slower accesses, after all.

You can turn it off by specifying your own empty "Pragma:" header line--that's
what the checkheaders check is for.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-11-12