Project

Profile

Help

Issue #3140

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

Added by pmoravec@redhat.com over 2 years ago. Updated 11 months ago.

Status:
CLOSED - DUPLICATE
Priority:
High
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
RHEL 7
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 29

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

Duplicates Pulp - Issue #2587: on_demand downloads aren't being cached by Squid CLOSED - CURRENTRELEASE Actions

History

#1 Updated by dalley over 2 years ago

  • Priority changed from Normal to High
  • Triaged changed from No to Yes

#2 Updated by ttereshc over 2 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/

#3 Updated by rchan about 2 years ago

  • Sprint/Milestone set to 48

#4 Updated by jortel@redhat.com about 2 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to jortel@redhat.com

#6 Updated by jortel@redhat.com about 2 years ago

  • Project changed from RPM Support to Pulp
  • Status changed from ASSIGNED to NEW
  • Assignee deleted (jortel@redhat.com)

#7 Updated by dkliban@redhat.com about 2 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dkliban@redhat.com

#8 Updated by dkliban@redhat.com about 2 years ago

  • Duplicates Issue #2587: on_demand downloads aren't being cached by Squid added

#9 Updated by dkliban@redhat.com about 2 years ago

  • Status changed from ASSIGNED to CLOSED - DUPLICATE

This was already fixed in 2.12.1

#11 Updated by bmbouter almost 2 years ago

  • Sprint set to Sprint 29

#12 Updated by bmbouter almost 2 years ago

  • Sprint/Milestone deleted (48)

#13 Updated by bmbouter 11 months ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF