Repository navigation
core: Make Application List cache timeout a configurable option - #26552
Closed
kensternberg-authentik wants to merge 3 commits into
Closed
kensternberg-authentik wants to merge 3 commits into
kensternberg-authentik wants to merge 3 commits into
Conversation
## What
Delete the second `cache.delete_many` in `PolicyViewSet.cache_clear`, because it expresses a subset of what is deleted in the first, so it effectively does nothing.
## Details
Both `core/api/applications.py` and `policies/api/policies.py` both import
from authentik.policies.types import CACHE_PREFIX
`policies/api/policies.py` performs the following cache-clearing:
keys = cache.keys(f"{CACHE_PREFIX}*")
cache.delete_many(keys)
keys = cache.keys(user_app_cache_key("*"))
cache.delete_many(keys)
However, the `user_app_cache_clear`, defined in `core/api/applications.py` includes the `CACHE_PREFIX` as its prefix; they’re not different:
"""Cache key where application list for user is saved"""
key = f"{CACHE_PREFIX}app_access/{user_pk}"
The second cache-clearing `.keys()` retrieval will always be empty. The effect does nothing.
… option ## What Adds a new field to AdminSettings: `applicationCacheTimeout`, makes it a TimeDelta field, applies the current value (24 hours) as the default, makes it visible in the API, and applies it `core/api/applications` to control the timeout for the application cache. Adds a corresponding field to the UI’s AdminSettingsForm. ## Why Answering issue \#26279: @BeryJu [suggested](#26279 (comment)): “A better option would including making the default cache duration shorter.” So why not make it configurable?
kensternberg-authentik
changed the base branch from
main
to
web/policies/remove-duplicate-cache-clear
September 29, 2026 20:51
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
❌ 5 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
Contributor
Playwright e2eDownload this run's HTML report and traces, then open the report: gh run download 36629233545 -D playwright-artifacts
npx playwright show-report playwright-artifacts/playwright-report |
kensternberg-authentik
marked this pull request as ready for review
September 29, 2026 21:14
BeryJu
reviewed
Sep 30, 2026
BeryJu
left a comment
Member
There was a problem hiding this comment.
change is good, imo this should be config setting in lib/default.yml
Base automatically changed from
web/policies/remove-duplicate-cache-clear
to
main
September 30, 2026 17:44
Contributor
Author
|
This is being closed in favor of #26596, which makes it a startup option in |
kensternberg-authentik
deleted the
web/policies/make-cache-clear-schedule-configurable
branch
October 30, 2026 23:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
core/applications: Make Application List cache timeout a configurable option
What
Adds a new field to AdminSettings:
applicationCacheTimeout, makes it a TimeDelta field, applies the current value (24 hours) as the default, makes it visible in the API, and applies itcore/api/applicationsto control the timeout for the application cache.Adds a corresponding field to the UI’s AdminSettingsForm.
Why
Answering issue #26279: @BeryJu suggested: “A better option would including making the default cache duration shorter.” So why not make it configurable?
Checklist
make all)make docs)