Errors when activating API Gateway's cache on AWS

aws

#1

We have a set of different APIs created by serverless (>= 1.18). They work nicely (with CORS) in production since months. Now I need to activate the API Gateway’s cache but the API gives me errors. Specifically I see this in browsers’ Javascript console:

No 'Access-Control-Allow-Origin' header is present on the requested resource.

When I press the “Flush cache” button in the API Gateway console, the first call to the API works (it doesn’t go through the CloudFront cache), but as soon as the resource gets cached again, I get the mentioned error again.

For the moment I have disabled all API caching, but this is going to create issues on the backend as usage of the API is increasing.

Is this a known problem or is there any configuration I’m missing?