FeatureFuel
1

API Cache doesn't respect custom headers

Source: directus/directus#24885 · opened by @piotr-cz
Describe the Bug


Directus API caching mechanism (particularly the [getCacheKey]( function) doesn't respect custom headers.

In effect when cache is enabled API returns exact same response to two requests with varying request header.

Possible solution: Add new Configuration Option to specify custom headers which will respected when creating cache key.

Related PR:

To Reproduce


1. Enable cache (CACHE_ENABLED=true)
1. Create [Custom API hook]( extension with following content:


1. Send valid request (responds with Status: 200 OK)


1. Send invalid request (should respond with Status: 503 Invalid token)


Errors Shown


No errors shown

What version of Directus are you using?


9.21.2

What version of Node.js are you using?


16.18.0

What database are you using?


MySQL

What browser are you using?


Chrome

How are you deploying Directus?


locally

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests