Open tj opened 7 years ago
Thought API gateway would do this effectively by default.. ?
CloudFront is in front of API Gateway as an implementation detail, but it doesn't actually do http caching. The cache that API Gateway provides is a region-specific local cache, as far as I know you'll get 100% misses from CF.
Oh sorry, I'm a bit confused since API gateway's Custom Domain Names gives me a XXXXXX.cloudfront.net URL, but after testing it curl -si https://XXXXXX.cloudfront.net | grep x-cache
... yes it's always a miss! :(
So the common practice is to put another CF in front of it? Or just avoid Custom Domain Names and put a CF in front of the invoke URL of the form https://XXXXX.execute-api.$region.amazonaws.com/$MYAPI/ ?
I wonder if the https://aws.amazon.com/certification/certified-developer-associate/ tests this crazy stuff. ;)
@tj I just ran into this. If I manually set CloudFront in front of my API, will I break future deploys?
@j you should be ok! I can't think of any issues there. If I add support in Up directly, it'll likely be opt-in so it shouldn't conflict with anything you have
CF isn't the most user-friendly thing but could add an integration to throw that up in front of your up app/site for http caching. Now possible with the regional endpoints.