简体   繁体   中英

CloudFront Cache HTML

Can Amazon CloudFront be used to cache HTML pages, and no just image, css files, etc?

If not, is there a comparable service out there that does this? IE, I overlay the service on a domain, and literally it only queries that site again, when the cached page has expired.

I looked at CloudFlare as well and they don't yet do this.

Yes, you can serve HTML through Cloudfront.

The main disadvantage is when you need to update the HTML as you are unable to version HTML for SEO reasons.

So by setting a cache into cloudfront of 1 hour for example it means that the page is kept into cloudfront for maximum 1 hour, and only after cloudfront will retake the HTML from your source and update it.

You can use invalidations on cloudfront to speed up the process but you need a full list of your html pages for a fast copy and paste into aws for invalidating.

Of course all this work for fixed webpages, that do not change for user. You can apply it even to ASP / PHP only if the generated content is fixed between all users. So you have the PHP into your origin , and cloudfront save the HTML of it.

My English is not the best one, so i hope i clear somethink...

Yes, you can serve HTML through CloudFront as long as you don't mind every user getting the same content until the cache expires.

I can't imagine a CDN that would not support this. They might not advertise it since many web sites are dynamic and can't be cached, but if your site is basically static, then any CDN should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM