a-luna / fastapi-redis-cache

A simple and robust caching solution for FastAPI that interprets request header values and creates proper response header values (powered by Redis)
MIT License
154 stars 24 forks source link

cache-control: no-cache behavior is wrong #52

Open a-luna opened 3 years ago

a-luna commented 3 years ago

per MDN, the HTTP 1.1 spec, and every other authoritative resource on this subject, the cache-control no-cache directive is NOT used to indicate that a response should not be cached.

This is rather unintuitive, but I probably should have known this before I went and built a caching plugin for FastAPI. I need to figure out exactly how to fix this, which will probably reveal even more places where I have violated the most basic of caching rules.

ionutbaltariu commented 2 years ago

Hello! Any progress on this issue? In my case it seems that the cache-control: no-cache|no-store header is simply ignored by fastapi-redis-cache, resulting in caching with an expiry period of 60 seconds.

My opinion that the cache-control: no-cache situation should be left for implementation for the users of the library.