4 ms·
Yeah maybe I'm misunderstanding what this person is referring to, but cloudfront definitely supports index pages in any directory
by VWWHFSfQ 3y ago
Yeah maybe I'm misunderstanding what this person is referring to, but cloudfront definitely supports index pages in any directory
- antihero 3y agoWhen was this added? I recall several years ago having to do this with edge lambdas. IE the it would happily resolve / to /index.html would be fine, but if you wanted to do /my-dir and have it resolve to /my-dir/index.html it would 404.
- Brajeshwar 3y agoNow that I'm curious because I remember facing no such issues. Cloudfront was my way of testing all of these scenarios to see what happens when the URL endpoint changes, etc. and then move to Akamai to scale up. Did some quick searches and I think there seems to be some kinks indeed and of course the solutions. Here are a few; - https://stackoverflow.com/questions/59634922/how-do-i-serve-index-html-in-subfolders-with-s3-cloudfront https://stackoverflow.com/questions/59634922/how-do-i-serve-... - https://aws.amazon.com/blogs/networking-and-content-delivery/implementing-default-directory-indexes-in-amazon-s3-backed-amazon-cloudfront-origins-using-cloudfront-functions/ https://aws.amazon.com/blogs/networking-and-content-delivery... Update/Edit: I think the setting to use correct S3 Endpoint makes a difference (which was indeed always my default way when I did). https://stackoverflow.com/questions/31017105/how-do-you-set-a-default-root-object-for-subdirectories-for-a-statically-hosted https://stackoverflow.com/questions/31017105/how-do-you-set-...
- antihero 3y agoYeah, I ended up writing a whole thing for it as part of my static website CDK construct. Here's the request edge lambda: https://github.com/radiosilence/cdk-static-web/blob/master/src/lambdas/request/index.ts https://github.com/radiosilence/cdk-static-web/blob/master/s... Here's the response edge lambda: https://github.com/radiosilence/cdk-static-web/blob/master/src/lambdas/response/index.ts https://github.com/radiosilence/cdk-static-web/blob/master/s... It's been a while since I've updated that project though. With nano-web for my current site (https://blit.cc https://blit.cc) I am just spinning up a free-tier unikernel instance on EC2 and using it as the CF origin. Possibly even more cost effective than S3, and far simpler. Response times for the "waiting" portion are usually around 5-10ms with CF and if I am going direct to the origin it's around 2-5ms