Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/long2ice/fastapi-cache
/ lifespan
Function
lifespan
examples/in_memory/main.py:17–19 ·
view source on GitHub ↗
(_: FastAPI)
Source
from the content-addressed store, hash-verified
15
16
@asynccontextmanager
17
async
def
lifespan(_: FastAPI) -> AsyncIterator[None]:
18
FastAPICache.init(InMemoryBackend())
19
yield
20
21
22
app = FastAPI(lifespan=lifespan)
Callers
nothing calls this directly
Calls
2
InMemoryBackend
Class · 0.90
init
Method · 0.45
Tested by
no test coverage detected