pulp_streamer doesnt set HTTP response headers, causing squid cache is not used
When installing a package from a repository with on demand download policy,
squid should cache the responses to 1) limit response times of further client requests, and 2) to save bandwidth between the pulp server and the upstream repo.
squid does not cache the responses / RPMs sent by
pulp_streamer, so any request from each and every client (re)fetching the package follows the full path
httpd-->squid-->pulp_streamer-->upstream-repo-->pulp_streamer-->squid-->httpd again. Including
deferred_download task as well.
The reason is
pulp_streamer does not set
HTTP response headers (
Expires required) required by
squid to determine expiration of the cache entry.
Two possible resolutions are possible:
pulp_streamerwill set the HTTP response headers accordingly,
squidwill be (recommended to be) configured to cache packages by default, using e.g.:
refresh_pattern .rpm$ 15 50% 4320
in `squid.conf`. Here I assume
deferred_download task running every 10 minutes, so an rpm object dealt as fresh for 15 minutes is more than enough. (I am not sure what all unit types can be queried via
squid so if the above rule covers everything)
Please register to edit this issue