{"repo":"long2ice/fastapi-cache","free":true,"listed":false,"github":"https://github.com/long2ice/fastapi-cache","clone":"git clone https://github.com/long2ice/fastapi-cache.git","description":"fastapi-cache is a tool to cache fastapi response and function result, with backends support redis and memcached.","language":"Python","stars":1867,"topics":["cache","fastapi","redis","memcached"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"fastapi-cache Introduction fastapi-cache is a tool to cache FastAPI endpoint and function results, with backends supporting Redis, Memcached, and Amazon DynamoDB. Features - Supports redis , memcache , dynamodb , and in-memory backends. - Easy integration with FastAPI. - Support for HTTP cache headers like ETag and Cache-Control , as well as conditional If-Match-None requests. Requirements - FastAPI - redis when using RedisBackend . - memcache when using MemcacheBackend . - aiobotocore when using DynamoBackend . Install or or or Usage Quick Start Initialization First you must call FastAPICache.init during startup FastAPI startup; this is where you set global configuration. Use the @cache decorator If you want cache a FastAPI response transparently, you can use the @cache decorator between the router decorator and the view function. Parameter type default description ------------ ---- --------- -------- expire int sets the caching time in seconds namespace str \"\" namespace to use to store certain cache items coder Coder JsonCoder which coder to use, e.g. JsonCoder key builder KeyBuilder callable default key builder which key builder to use injected dependency namespace str fastapi cache prefix for injected dependency keywords. cache status header str X-FastAPI-Cache Name for the header on the response indicating if the request was served from cache; either HIT or MISS . You can also use the @cache decorator on regular functions to cache their result. Injected Request and Respo","default_branch":null,"files":null,"tree":[],"storefront":"/r/long2ice","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/long2ice/fastapi-cache/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}