I’ve set up the enterprise trail including the cache plugin but failed to actually get the cache-control headers working as described in https://docs.konghq.com/hub/kong-inc/proxy-cache/#cache-control Does it really support the full RFC7234 including the client-side headers?
Hi and welcome to Kong Nation
Following your post, I did some tests.
It seems that, when the config.cache_control is set to true, nothing is stored in the cache and we only received ByPass in X-Cache-Status.
However, if the config.cache_control is set to false and you perform some request and so the cache starts to be filled, then when you activate the config.cache_control (set to true), providing the Cache-Control header works well with the cache.
For exemple, I did some requests, then set config.cache_control to true, and then did my requests again with Control-Cache:max-age=300 and then with Control-Cache:max-age=1
The first one answers with X-Cache-Status: Hit and the second one answers with X-Cache-Status: Bypass.
So the problem seems to be storing in the cache when cache_control=true. (As if the no-store directive was set as default…). Once something is stored in the cache, the Control-Cache seems to work as expected.
Hope it will help if somebody looks closer at the issue