You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want cache `fastapi` response transparently, you can use `cache_response` as decorator between router decorator and view function and must pass `request` as param of view function.
79
+
If you want cache `fastapi` response transparently, you can use `cache` as decorator between router decorator and view function and must pass `request` as param of view function.
75
80
76
81
And if you want use `ETag` and `Cache-Control` features, you must pass `response` param also.
77
82
78
-
### Use `cache`
79
-
80
-
You can use `cache` as decorator like other cache tools to cache common function result.
83
+
You can also use `cache` as decorator like other cache tools to cache common function result.
81
84
82
85
### Custom coder
83
86
84
87
By default use `JsonCoder`, you can write custom coder to encode and decode cache result, just need inherit `fastapi_cache.coder.Coder`.
0 commit comments