Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid caching page headers #3125

Merged
merged 3 commits into from
Mar 4, 2024
Merged

Conversation

mathjazz
Copy link
Collaborator

Fix #3124.

@mathjazz mathjazz requested a review from eemeli February 27, 2024 18:17
Comment on lines 20 to 30
team_pretranslation_quality = cache.get_or_set(
f"/{__name__}/team_pretranslation_quality",
get_global_pretranslation_quality("locale", "code"),
settings.VIEW_CACHE_TIMEOUT,
)

project_pretranslation_quality = cache.get_or_set(
f"/{__name__}/project_pretranslation_quality",
get_global_pretranslation_quality("entity__resource__project", "slug"),
settings.VIEW_CACHE_TIMEOUT,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why write these in the cache? This appears to be the only place where the values are used, and with get_or_set() the get_global_..._quality() function is always called.

@mathjazz mathjazz requested a review from eemeli March 4, 2024 13:07
@mathjazz mathjazz merged commit e8f2b19 into mozilla:main Mar 4, 2024
4 checks passed
@mathjazz mathjazz deleted the 3124-do-not-cache-headers branch March 4, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Headers on /contributors and /insights pages are cached
2 participants