Project

Profile

Help

Issue #3140

closed

pulp_streamer doesnt set HTTP response headers, causing squid cache is not used

Added by pmoravec@redhat.com about 7 years ago. Updated over 5 years ago.

Status:
CLOSED - DUPLICATE
Priority:
High
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
RHEL 7
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Sprint 29
Quarter:

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

Is duplicate of Pulp - Issue #2587: on_demand downloads aren't being cached by SquidCLOSED - CURRENTRELEASEjortel@redhat.comActions

Also available in: Atom PDF