-
Notifications
You must be signed in to change notification settings - Fork 24
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 decorator is getting skipped #33
Comments
FastAPI endpoints are created by decorating a function with a path operation that specifies the HTTP method that the endpoint responds to ( The @app.get("/new_order")
@cache()
def GetNewOrder(request: Request):
...
return Response(status_code = resp.status_code, content = resp.content, headers = cleanupRespHeaders(resp.headers)) Let me know if this fixes things for you! |
Thanks for the quick response! Sorry I left the
One other thought is that I'm making at least one internal API call for each route, so there's at least one extra request and response object in each call (although I am using the requests module for these calls, not FastAPI). Could that disrupt the decorator in any way, or does the decorator only pick up the FastAPI response that my route actually returns? |
This issue seems similar to my new issue: #58 |
Hello,
I am facing an error where the @cache decorator does not seem to be producing any output or writing any keys.
I started the Redis client according to the docs:
and applied the decorator as follows:
When I check my server output, I see where redis_cache successfully connects to my Redis server, but I'm not getting any output that indicates that it's caching, and I'm not getting any new keys in my Redis database. Any idea if I'm missing some setup step or doing something else wrong here?
The text was updated successfully, but these errors were encountered: