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

Cache stats/ endpoint to avoid too many requests to database #654

Closed
mjeammet opened this issue Jan 20, 2025 · 2 comments · Fixed by #661
Closed

Cache stats/ endpoint to avoid too many requests to database #654

mjeammet opened this issue Jan 20, 2025 · 2 comments · Fixed by #661
Assignees
Labels
backend enhancement New feature or request

Comments

@mjeammet
Copy link
Contributor

Context

We want /stats endpoint to be public. But we need to limit its queries to our database.

Suggestion

@sylvinus suggests @method_decorator(cache_page(3600)) (https://www.django-rest-framework.org/api-guide/caching/#using-cache-with-apiview-and-viewsets) with some use of cache.clear() in related tests

@mjeammet mjeammet added backend enhancement New feature or request labels Jan 20, 2025
@mjeammet mjeammet linked a pull request Jan 22, 2025 that will close this issue
2 tasks
@mjeammet
Copy link
Contributor Author

Finalement mergé ici #661

@mjeammet mjeammet linked a pull request Jan 27, 2025 that will close this issue
@mjeammet
Copy link
Contributor Author

Added in release v1.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend enhancement New feature or request
Projects
None yet
2 participants