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
Actions #1

Updated by dalley about 7 years ago

  • Priority changed from Normal to High
  • Triaged changed from No to Yes
Actions #2

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/

Actions #3

Updated by rchan about 7 years ago

  • Sprint/Milestone set to 48
Actions #4

Updated by jortel@redhat.com about 7 years ago

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

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)
Actions #7

Updated by dkliban@redhat.com about 7 years ago

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

Updated by dkliban@redhat.com about 7 years ago

  • Is duplicate of Issue #2587: on_demand downloads aren't being cached by Squid added
Actions #9

Updated by dkliban@redhat.com about 7 years ago

  • Status changed from ASSIGNED to CLOSED - DUPLICATE

This was already fixed in 2.12.1

Actions #11

Updated by bmbouter almost 7 years ago

  • Sprint set to Sprint 29
Actions #12

Updated by bmbouter almost 7 years ago

  • Sprint/Milestone deleted (48)
Actions #13

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF