Issue #3140
closedpulp_streamer doesnt set HTTP response headers, causing squid cache is not used
Description
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.
But 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 (Last-Modified
and Expires
required) required by squid
to determine expiration of the cache entry.
Two possible resolutions are possible:
-
pulp_streamer
will set the HTTP response headers accordingly, - or
squid
will 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)
Related issues
Updated by dalley about 7 years ago
- Priority changed from Normal to High
- Triaged changed from No to Yes
Updated by ttereshc about 7 years ago
A suggestion from the BZ:
Hi, they don't need to use explicitly Last-Modified, they can use Cache-Control header with max-age param etc.
There is nice page, which explains caching: https://www.mnot.net/cache_docs/
Updated by jortel@redhat.com about 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to jortel@redhat.com
Updated by jortel@redhat.com about 7 years ago
- Project changed from RPM Support to Pulp
- Status changed from ASSIGNED to NEW
- Assignee deleted (
jortel@redhat.com)
Updated by dkliban@redhat.com about 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dkliban@redhat.com
Updated by dkliban@redhat.com about 7 years ago
- Is duplicate of Issue #2587: on_demand downloads aren't being cached by Squid added
Updated by dkliban@redhat.com about 7 years ago
- Status changed from ASSIGNED to CLOSED - DUPLICATE
This was already fixed in 2.12.1