-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Question] Method post is caching? #57
Comments
Just for |
@victorparra96 you can modify the decorator like this to enable caching for POST https://github.com/long2ice/fastapi-cache/blob/master/fastapi_cache/decorator.py#L53 if request.method not in {"GET", "POST"}:
return await func(request, *args, **kwargs) I haven't personally experimented this with this library, but I have done this with https://github.com/a-luna/fastapi-redis-cache |
Can we move this into the main branch? Definitely seems useful. |
agreed, would definitely find this useful |
@long2ice I believe that caching POST requests or any request method can be done because we can leverage the key_builder parameter. What do you think, if it's possible, I would like to submit a pull request for it. |
We should probably consolidate this into a single issue. I've commented on #75, which is the same issue. |
I try cache for fastapi but i not know if post method is caching, or is only for get method
The text was updated successfully, but these errors were encountered: