yum & "pragma: no-cache" (was Re: F18 DNF and history)

Nicolas Mailhot nicolas.mailhot at laposte.net
Mon Jul 2 07:52:04 UTC 2012


Le Ven 22 juin 2012 15:22, Reindl Harald a écrit :
>
>
> Am 22.06.2012 15:17, schrieb Zdenek Pavlas:
>>> From: "Nicolas Mailhot" <nicolas.mailhot at laposte.net>
>>> can we get a package downloader that sends the correct
>>> cache-control http headers to refresh data automatically
>>> instead of complaining metadata is wrong and aborting
>>> (for people behind a caching proxy)?
>>
>> Have you tried changing http_caching option in yum.conf
>> from (default) 'all' to 'packages'?
>
> this is nothing which can be controlled properly by
> the client - the server is responsible for caching-headers
>
> Cache-Control: private
> Pragma: private
>
> and no longer will any proxy cache the file while
> the client itself is allowed to do so
>
> this is the only technical clean solution for "people behind a
> caching proxy" and the problem a proxy may have cached wrong
> metadata

Thank you very much I know how a proxy works. My beef with yum is that after
years of reports it does not seem to know how how proxy work yet, and offers
only an all-or-nothing manual http_caching hammer when things should work
transparently with proxies by default.

But, anyway:

1. The only item that should require retrieving with caching off is the master
index file since all the other index files can be made trivialy proxy-safe by
using unique (timestamped) names and can be referenced from this file.

2. to force no caching of this file it should include the correct cache
control metadata (probably forces it to be an xhtml or html file since most
equipments won't read this metadata elsewhere). That is, absent a way to
control the headers send by mirrors which seems challenging organisationnaly
(though an adding an .htaccess file with the correct instructions could help)

3. yum should always send "Pragma: No-cache" or "Cache-Control: no-cache" when
retrieving this file


Regards

-- 
Nicolas Mailhot



More information about the devel mailing list