Reputation: 221
All infra is on GCP. When I set a "Cache-Control: public, max-age=86400" response header on my endpoint that is served by a 2nd generation cloud function, the API gateway is caching the response. When I change my endpoint to set the "Cache-Control: no-cache" response header, the API gateway continues to return the original response, despite the change in cache header. When I call the function's own endpoint I get the correct cache header value.
The flow is: Load Balancer -> API Gateway -> Cloud Functions. Calling via LB gives wrong TTL Calling via API Gateway gives wrong TTL Calling Cloud Function directly gives correct TTL
The API Gateway docs don't mention caching anywhere, Load Balancer does not have caching/CDNs enabled, and given that API gateway is downstream and calling it produces wrong TTL, seems this is the issue originating from API Gateway.
Steps to reproduce:
The only way I could clear the cache was to deploy a new gateway with the same api spec. Maybe there is a purge functionality that could be invoked, would be keen to explore the options.
Upvotes: 3
Views: 176