138 points · by emforce · 8y ago · 61 comments
The other one to consider is Google Firebase Static Hosting. Really excellent performance.
Corrupted Content Error The site at https://www.netlify.com/pricing has experienced a network protocol violation that cannot be repaired.
Never seen this error before. Seems okay in Chrome and IE, so not sure what's going on in Firefox.
HE.net is currently advertising 10gig ethernet for $1300/mo. Obviously there are various scaling issues associated with this but the basic premise still holds - AWS and other cloud services need major pressure to push their bandwidth prices down.
With cloudfront (or any other edge cache system), you get TCP termination closer to end-users so the site loads faster, particularly if you have users around the world. Dropbox case study: https://blogs.dropbox.com/tech/2017/06/evolution-of-dropboxs...
Edge cache bandwidth costs quite a bit more than the not quite bottom of barrel IP transit that HE.net is selling.
I have about 75% of a blog post about how to do this, it's not terribly complicated. This comment just gave me the motivation to finish it, I'll post it on HN when it's ready.
I'm guessing a couple of Cache-Control: headers would have provided similar latency improvements.
I had set Browser Cache Expiration to 1 month within my CloudFlare settings as was luckily screenshotted within a previous article: https://medium.com/@elliot_f/my-journey-into-web-speed-optim...
I'm fairly sure that I had some speed optimizations set within my Nginx server block. Unfortunately, I don't have the Nginx config file to hand anymore as I've (somewhat stupidly) deleted the snapshots without taking a backup.
Specifically though we're talking about how long Cloudflare caches your content on their proxy/edge servers. Browser caching is irrelevant for this discussion, as speed tests of this nature should always be performed on a clean request.
And just to clarify, based on some of the articles I've read, I actually think CloudFlare may be a better choice of CDN, this post just highlights one way of achieving a global-scale website and doing it in such a way that it's resilient and cheap as chips!
I don't actually know cloudflare personally, but assuming they're following the spec, you need to set "Cache-Control: max-age=300" or "Cache-Control: s-maxage=300" to tell cloudflare to cache a given response for 5 minutes.
$6/month = 250GB of static websites + domain registration fees.
If you want to get really cheap, OVH's cloud storage is basically free but you lose https. ($.01/GB of traffic/storage roughly)
I do it as the last step in my CI/CD process:
- aws configure set preview.cloudfront true
- aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_ID --paths '/*'
- curl https://google.com/ping?sitemap=$SITEMAP_URLA static website cached by cloudflare seems very vanilla.
Also, why S3? this seems very easy to do with Linode or anything else similarly cheap or cheaper ($20 gets you a KVM VPS with 2 Gb nowadays)
Unless you have to regenerate constantly, all it needs is nginx, to serve the pages to Cloudflare edges when thry drop out of the cache
Also, why do you need a server at all? If you are doing nothing but serving static files then why incur the overhead of maintaining LetsEncrypt certificates and writing Nginx config files? AWS provides a simple interface in which you can view and manage your static files without having to ssh into a server.
On the point of price, I'm predicting my total cost of hosting for a site serving roughly 40-45k users per month will be roughly $7/month. All whilst minimizing the amount of administration time required and monitoring of a more traditional system.
Hope this clarifies this, would be keen to hear any counter thoughts!
12x24x100= lots of mb per day
S3 costs (if only for the bandwidth) will be greater than a server with a fair share unlimited connection
Also, cloudfront non free plans will kill you - again because of the bandwith.
This is probably an exceptional rate of change for the _vast_ majority of static sites.
My deployment is shell scripts launched by systemd timers
Instead of downvoting, can someone please explain why this setup that is stable is not up to whatever standards?