mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
Use just three code paths: uncacheable, cache miss and cache hit. This makes it much easier to follow what happens for each case. the only places where the inner function now exits early are when the call is uncacheable, or when there is a cache hit and the request included a matching If-Not-Modified header. - Use a utility function to capture when a request should not use the cache - Use the starlette.status constant for the 'not modified' status for code clarity. - Use `setattr()` for the inner function signature, avoiding the need for a type checker override comment.