The Proxy Caching Advanced plugin always hits the API instead of caching, as indicated by the x-cache-status: bypass header in the response.
Why the Proxy Caching Advanced plugin always bypasses the cache
Uses:
Kong Gateway
TL;DR
Why is the Proxy Caching Advanced plugin always bypassing the cache and hitting the API?
The upstream response’s content type isn’t included in the plugin’s configuration.
Check the content type with curl -v, then add it to the plugin config.
Problem
Cause
The Proxy Caching Advanced plugin bypasses the cache and hits the API when the upstream response’s content type is not included in the plugin’s configuration.
Solution
- Check the upstream content type with
curl -v. - Update the plugin configuration to include that content type.
-
(Optional) Adjust NGINX buffer sizes if you’re dealing with large responses:
KONG_NGINX_HTTP_PROXY_BUFFERS="8 16k" - Verify the fix by confirming
x-cache-statusshowsHITon repeated requests.
Ensuring the plugin is configured with the correct content types is the key to enabling proper caching behavior.