Caching custom api endpoint not working
CherniyIrtish opened this issue · comments
Oleksii Com commented
Describe the Bug
Caching doesn't work for custom api endpoints
Based on docs: https://docs.directus.io/self-hosted/config-options.html#cache
I setup needed headers
CACHE_STATUS_HEADER: 'Header-Name'
CACHE_ENABLED: 'true'
CACHE_NAMESPACE: 'system-cache'
It perfectly works for build-in endpoints, for instance getting collections
host/items/collection - works
host/custom-endpoint - 'Header-Name' always has MISS value
To Reproduce
- Create custom endpoint
- Set needed env variables
CACHE_STATUS_HEADER: 'Header-Name'
CACHE_ENABLED: 'true'
CACHE_NAMESPACE: 'system-cache' - Call custom endpoint
Directus Version
10.11.0
Hosting Strategy
Self-Hosted (Docker Image)
Database
No response