Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Set up a tallies cache alias for tracking longer-term values #1072

Closed
AetherUnbound opened this issue Jan 4, 2023 · 1 comment · Fixed by #1088
Closed

Set up a tallies cache alias for tracking longer-term values #1072

AetherUnbound opened this issue Jan 4, 2023 · 1 comment · Fixed by #1088
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟩 priority: low Low priority and doesn't need to be rushed 🐍 tech: python Requires familiarity with Python

Comments

@AetherUnbound
Copy link
Contributor

Problem

We are presently using the default django.core.cache alias for tracking view caches & authentication information in addition to general tallies and aggregates we wish to track. This means that we have both cache and (ostensibly) longer-term data living in the same Redis database, and (unless explicitly adjusted) existing under the same TTLs.

Description

We would like to set up a separate cache alias, tallies, which could be used to store longer-living values. The two examples that come to mind would be the dead link tallies that are accumulated in validate_images, and the thumbnail domain timeouts that were added in #982.

This alias could have a longer (or nonexistent) TTL, with the option to define individual timeouts when writing to the cache.

We should also check through other uses of the cache and swap any uses that are not view caches & authentication info to use tallies.

@AetherUnbound AetherUnbound added ✨ goal: improvement Improvement to an existing user-facing feature 🐍 tech: python Requires familiarity with Python 💻 aspect: code Concerns the software code in the repository 🟩 priority: low Low priority and doesn't need to be rushed labels Jan 4, 2023
@sarayourfriend
Copy link
Contributor

This alias could have a longer (or nonexistent) TTL, with the option to define individual timeouts when writing to the cache.

I think it should specifically have no TTL for this usecase and if entries need to be timestamped (or a record kept of "last updated") then secondary keys can be used to accomplish that.

The other use of cache that exists in the validate images function is the dead link mask. This needs to retain its existing behaviour and uses a hand-configured TTL. Just want to note that for whomever works on this issue: be sure to keep an eye out for not accidentally changing the behaviour of the dead link masks 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟩 priority: low Low priority and doesn't need to be rushed 🐍 tech: python Requires familiarity with Python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants