fastapi-cache icon indicating copy to clipboard operation
fastapi-cache copied to clipboard

Add no-store, no-cache in Cache-Control headers

Open Bharat23 opened this issue 1 year ago • 23 comments

Changes

  • Removed the logic to never use cache if either of no-cache/no-store was present
  • Instead they work as follows
  • no-cache: doesn't use cache even if the value is present but stores the response in the cache
  • no-store: can use cache if present but will not add/update to cache
  • If both are passed, it will neither store nor use the cache. Will remove the max-age and ETag as well.
  • Test cases

Associated Issue: https://github.com/long2ice/fastapi-cache/issues/144

Bharat23 avatar Jan 10 '24 04:01 Bharat23