Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Cache-Control: max-age=0" Per-key cache invalidation doesn't do anything

I have an API Gateway and a lambda which query on it. I have set the cache ttl on the API Gateway to the maximum (3600).

I'm testing the API from Postman. My cache is working as querying multiple time the exact same url returns me the result quite fast.

On some conditions, I need the lambda to invalidate the cache for a specific key. So I deactivated "require authorization" under "Per-key cache invalidation" in the API Gateway stage editor, and I'm trying with Postman to do the same query and adding "Cache-Control: max-age=0" header as written here under the "Invalidate an API Gateway Cache Entry" section.

http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html

However, my cache doesn't seem to empty as querying multiple times is still as fast.

like image 331
Romain Avatar asked Oct 30 '25 15:10

Romain


1 Answers

Postman silently overrides "Cache-Control" header value to "Cache-Control: no-cache". You are able to see it when press "Code" button. Try to use other tool, curl for instance.

like image 100
Kolodiazhnyi Oleksandr Avatar answered Nov 02 '25 21:11

Kolodiazhnyi Oleksandr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!