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

Enhancement: Allow the cache to specify the namespace on a route level #3854

Open
dylandoamaral opened this issue Nov 12, 2024 · 0 comments
Open
Labels
Enhancement This is a new feature or request

Comments

@dylandoamaral
Copy link

dylandoamaral commented Nov 12, 2024

Summary

Today, every cached response is cached inside the namespace "response_cache" or any namespace you defined in a root level. However, I would like certain route to be cached on different namespace to manage the cache invalidation differently according to the response.

Basic Example

@get(cache=True, cache_namespace='another_response_cache', sync_to_thread=False)
def cached_handler() -> str:
    # this will use app.stores.get("response_cache")
    return "Hello, world!"

Drawbacks and Impact

No response

Unresolved questions

No response


Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@dylandoamaral dylandoamaral added the Enhancement This is a new feature or request label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is a new feature or request
Projects
None yet
Development

No branches or pull requests

1 participant