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

Return cached header fields

Open vanderGoes opened this issue 9 months ago • 2 comments

The current functionality of fastapi-cache is not returning the cached headers, only the cached body with the regular headers. This limitation is affecting the possible usage of this package in a ForwardAuth middleware of Traefik.

Adding this as a custom method via the @cache decorator is not available.

Can we enable returning the headers by:

  • adding a flag to cache and return all headers
  • or via a custom method (like key_builder) to return selected headers?

vanderGoes avatar Sep 04 '23 11:09 vanderGoes