Skip to content

Commit

Permalink
Reduce the cache entry expiration TTL
Browse files Browse the repository at this point in the history
If Redis goes down then its persisted data can get out of sync with
Pulp, because cache invalidation events cannot occur. We should mitigate
the impact by letting cache entries expire after a shorter period of
time.

closes: #8996
https://pulp.plan.io/issues/8996
  • Loading branch information
dralley committed Jul 13, 2021
1 parent ca0ef8f commit 017b0b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/8996.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduced the default expiration TTL of entries in the Pulp content app cache.
2 changes: 2 additions & 0 deletions docs/configuration/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ CACHE_SETTINGS

* ``EXPIRES_TTL`` - Number of seconds entries should stay in the cache before expiring.

Defaults to ``600`` seconds.

.. note::
Set to ``None`` to have entries not expire.
Content app responses are always invalidated when the backing distribution is updated.
Expand Down
2 changes: 1 addition & 1 deletion pulpcore/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
# https://docs.pulpproject.org/pulpcore/configuration/settings.html#pulp-cache
CACHE_ENABLED = True
CACHE_SETTINGS = {
"EXPIRES_TTL": 86400,
"EXPIRES_TTL": 600, # 10 minutes
}

SPECTACULAR_SETTINGS = {
Expand Down

0 comments on commit 017b0b1

Please sign in to comment.