Scaling Your Static Site to a Global Market for a Fraction of the Cost on AWS
medium.com
medium.com
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.
The other one to consider is Google Firebase Static Hosting. Really excellent performance.
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.
I also doubt that many static sites have much "overhead" related to maintaining nginx config files and Let's Encrypt certificates.
The person you're talking to is likely thinking of the "100=>101" case, not the "0=>1" case.
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?
Anyway, if someone can manage to access my servers with only nginx serving static files, they deserve to 0wn it :-)
While your setup stays the same, major security flaws are found in different parts of the stacks.
Security is a process, by neglecting it you're paying for resources that are abused by attackers in order to harm other users.
Security is a state of mind, not a bunch of recipes. Some things must be protected, some for some others it doesn't make sense
Security is a state of mind, indeed.
* Inject a cryptocurrency miner JavaScript into your page during the transmission of your static HTML page to your clients, without you or your users knowing it [1]
* Injecting explicit, illegal image material that would get your clients immediately in legal trouble for possession of such material, without you knowing
* Injecting a JS snippet that, instead of your site's contents, shows a fake antivirus page, telling the clients that your site is malicious and that a threat was eliminated by Fake Antivirus 10.0 and that they should immediately call Microsoft Support (Phone number in Bangladesh) for further "assistance". There they're told they need to get a full cleaning of the hard drive for only 99$ and are asked for their CC number
The point is: If you don't have end-to-end-encryption, you can never be sure what your users see. They might see your site - or some slightly modified version of your site, with a login box, phishing passwords from your users, abusing their trust in your brand.
A MITM has nothing to do with someone gaining access to your server. It's someone gaining access to infrastructure - a vulnerable public wifi, for instance.
[1] https://www.hacking.reviews/2018/01/coffeeminer-collaborativ...
Doing anything else than putting cloudflare in front of my nginx is needlessly overhead- because cloudflare scales quite well!