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
when request is present, cache is disabled #107
Comments
because when request is present, it will run there fastapi-cache/fastapi_cache/decorator.py Line 151 in 8f0920d
|
Pretty sure this was never an issue, but perhaps the refactoring work done in #139 makes it easier to understand when caching is applied and when not. The request and response objects remain optional, meaning the original methods can be called directly without having to pass in a request or response object unless those methods specifically need them. This is what the decorator does; wherever these steps reference the request or response, those parts are skipped if no request or response is present:
Specifically, this is what this looks like: fastapi-cache/fastapi_cache/decorator.py Lines 135 to 207 in 4c4a7d6
|
Due to this line:
fastapi-cache/fastapi_cache/decorator.py
Line 128 in 8f0920d
When request is present, cache is disabled. Why do we do so? Isn't it quite normal if user want to customize key builder that takes in request object?
I can create a pr to fix this but just wondering why the design is so in the first place.
The text was updated successfully, but these errors were encountered: