1

Cheers,

I have a deployed Amazon API Gateway that is working perfectly when the API Gateway Cache is not turned on, but returns only empty results when I turn the cache on.

Design: API Gateway => Lambda function (custom authorization) => Lambda function (retrieving actual data)

Without cache I get CloudWatch log entries for both the authorization function and the actual data function, but with cache it seems only the authorization function is called (authorization looks ok) and the actual data is never retrieved.

The results returned to the client look completely similar (200 OK) with the only difference being no data is returned when cache is enabled.

Any ideas how to debug this or what might be the problem? :)

2
  • I can't diagnose the specific problem in your case without additional information. If you want to post or PM me your region and API URL then I can look at the configuration. Commented Jun 30, 2016 at 1:02
  • One common problem with caching is enabling caching for a stage which enables caching for all resources/methods by default. Most customers only want to cache GET responses and need to disable caching on other methods. Commented Jun 30, 2016 at 1:02

1 Answer 1

1

We have exactly the same issue with AWS API Gateway. Enabling cache on some GET methods using the x-amazon-apigateway-integration and enabling the cache at Stage level. The responses for GET methods cached returns 200 and empty payload. We use custom authorizer with lambda function, so normally we should test if the query is authorized to access to our API. I even try to put cache-control: max-age=0 to force the refresh of cache without success.

For me the AWS APIG Cache doesn't work at all!

I found some comments on the WEB which advices to disable it and use the CloudFront one. So I am little bit lost, the Cache is a feature of the API Gateway but can't use it?

Sign up to request clarification or add additional context in comments.

1 Comment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.