diff --git a/README.md b/README.md index d4c5477..3f83aed 100644 --- a/README.md +++ b/README.md @@ -82,12 +82,18 @@ Firstly you must call `FastAPICache.init` on startup event of `fastapi`, there a 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. +Parameter | type, description +------------ | ------------- +expire | int, states a caching time in seconds +namespace | str, namespace to use to store certain cache items +coder | which coder to use, e.g. JsonCoder +key_builder | which key builder to use, default to builtin + + And if you want use `ETag` and `Cache-Control` features, you must pass `response` param also. You can also use `cache` as decorator like other cache tools to cache common function result. -`expire` parameter states a caching time in seconds. - ### Custom coder By default use `JsonCoder`, you can write custom coder to encode and decode cache result, just need inherit `fastapi_cache.coder.Coder`.