*

Offline la xasop

  • Administrator
  • *****
  • Posts: 6338
  • Professional computer somebody
    • View Profile
Use CloudFlare for serving static content
« on: December 03, 2013, 01:49:08 PM »
Another reminder thread for myself, this time to set up the Amazon CloudFront CDN to serve static files, like CSS and images. This should dramatically improve page load times for people not living near California, especially if we configure SMF to force all avatars to not be externally hosted.
« Last Edit: December 07, 2013, 09:15:11 AM by Parsifal »
when you try to mock anyone while also running the flat earth society. Lol

*

Offline la xasop

  • Administrator
  • *****
  • Posts: 6338
  • Professional computer somebody
    • View Profile
Re: Use CloudFront for serving static content
« Reply #1 on: December 03, 2013, 02:56:11 PM »
CloudFlare would be another option, but I have some reservations. It would have some additional benefits (both for performance and security) over CloudFront, though, so I'll look into that option further before making a decision.

Edit: One of the performance benefits of CloudFlare could be equally satisfied with Amazon's Route 53 DNS service, so now I'm torn again.
« Last Edit: December 03, 2013, 02:58:24 PM by Parsifal »
when you try to mock anyone while also running the flat earth society. Lol

*

Offline la xasop

  • Administrator
  • *****
  • Posts: 6338
  • Professional computer somebody
    • View Profile
Re: Use CloudFront for serving static content
« Reply #2 on: December 03, 2013, 04:56:43 PM »
I've had a chance to think about this a bit, and Amazon is definitely the best fit for our needs. I'll move our DNS across to Route 53 in the coming days, which will allow me to begin working on setting up CloudFront.
when you try to mock anyone while also running the flat earth society. Lol

*

Offline Rushy

  • Planar Moderator
  • *****
  • Posts: 7247
    • View Profile
Re: Use CloudFront for serving static content
« Reply #3 on: December 04, 2013, 01:52:09 AM »
I was under the impression CloudFlare's main benefit was denial of service protection, is that not their primary product or is that just a result of what they offer?

*

Offline la xasop

  • Administrator
  • *****
  • Posts: 6338
  • Professional computer somebody
    • View Profile
Re: Use CloudFront for serving static content
« Reply #4 on: December 04, 2013, 01:56:51 AM »
I was under the impression CloudFlare's main benefit was denial of service protection, is that not their primary product or is that just a result of what they offer?

The thing with CloudFlare is that they have several "main benefits" that are roughly equal, rolled into the one service. You can use it as a CDN with no DDoS protection at all, or you can use it to keep attackers and spammers away without caching anything. You could even just use it as a DNS provider and nothing else (although that would probably be silly).

Anyway, I've gone with Amazon in the end. So far, I've set up tfes.org in Route 53 for DNS; later, I'll switch that to being our primary domain name. At some point, I'll then be setting up CloudFront backing onto this server for the CMS, the wiki and the forum's static content; as well as CloudFront backed onto S3 for the Flat Earth Library.
when you try to mock anyone while also running the flat earth society. Lol

*

Offline Rushy

  • Planar Moderator
  • *****
  • Posts: 7247
    • View Profile
Re: Use CloudFront for serving static content
« Reply #5 on: December 04, 2013, 01:59:43 AM »
I hope that solves the DNS unresolved name error that I've been receiving. The base uses its own DNS server that does not like routing the name of this site.

*

Offline la xasop

  • Administrator
  • *****
  • Posts: 6338
  • Professional computer somebody
    • View Profile
Re: Use CloudFront for serving static content
« Reply #6 on: December 04, 2013, 10:57:12 AM »
We are now using Amazon for DNS, having switched to tfes.org for our primary domain. This will make it easier to transition to CloudFront in the future.
when you try to mock anyone while also running the flat earth society. Lol

*

Offline la xasop

  • Administrator
  • *****
  • Posts: 6338
  • Professional computer somebody
    • View Profile
Re: Use CloudFront for serving static content
« Reply #7 on: December 06, 2013, 01:28:45 PM »
This is really quite incredible. The www.tfes.org homepage loads slower using Amazon's CDN (which has a node here in Sydney) than it does directly from my VPS across the Pacific. For images around 20-30 kB, the load time is around the same.

I'm unconvinced of the merit of using this CDN at this point. There would be the benefit of high availability, which means I could use the main website to post status updates if and when my VPS goes down. I think I'll sleep on it.


For anyone who wants to test it out, you can access Amazon's copy of the site at https://dxg6c29e1dr2m.cloudfront.net/. (Yes, this will appear in your browser as www.tfes.org eventually if we switch to using it.)
« Last Edit: December 06, 2013, 01:30:47 PM by Parsifal »
when you try to mock anyone while also running the flat earth society. Lol

Offline emily

  • *
  • Posts: 18
  • Lady Admiral of Reason
    • View Profile
Re: Use CloudFront for serving static content
« Reply #8 on: December 06, 2013, 02:54:23 PM »
I'm unconvinced of the merit of using this CDN at this point. There would be the benefit of high availability, which means I could use the main website to post status updates if and when my VPS goes down. I think I'll sleep on it.

AWS' CDN uses their slower S3 servers - it's more about offloading requests from your servers, rather than actually using faster servers. So if your VPS isn't under strain, it's probably better to leave it like that. Probably better to just focus on preventing your VPS from going down ;)
If you have to ask, you don't know

*

Offline Lord Dave

  • *
  • Posts: 5850
  • Grumpy old man.
    • View Profile
Re: Use CloudFront for serving static content
« Reply #9 on: December 06, 2013, 03:22:04 PM »
I'm unconvinced of the merit of using this CDN at this point. There would be the benefit of high availability, which means I could use the main website to post status updates if and when my VPS goes down. I think I'll sleep on it.

AWS' CDN uses their slower S3 servers - it's more about offloading requests from your servers, rather than actually using faster servers. So if your VPS isn't under strain, it's probably better to leave it like that. Probably better to just focus on preventing your VPS from going down ;)
I didn't see this coming.

*

Offline spoon

  • *
  • Posts: 1134
  • Foxy wins
    • View Profile
Re: Use CloudFront for serving static content
« Reply #10 on: December 06, 2013, 10:37:32 PM »
emily is probably a guy.
inb4 Blanko spoons a literally pizza

*

Offline Pete Svarrior

  • e
  • Planar Moderator
  • *****
  • Posts: 12125
  • (>^_^)> it's propaganda time (◕‿◕✿)
    • View Profile
    • The Flat Earth Society
Re: Use CloudFront for serving static content
« Reply #11 on: December 06, 2013, 10:55:22 PM »
Read the FAQ before asking your question - chances are we've already addressed it.
Follow the Flat Earth Society on Twitter and Facebook!

<Parsifal> I like looking at Chinese Wikipedia with Noto installed
<Parsifal> I don't understand any of it but the symbols look nice

Offline emily

  • *
  • Posts: 18
  • Lady Admiral of Reason
    • View Profile
Re: Use CloudFront for serving static content
« Reply #12 on: December 06, 2013, 10:57:16 PM »
If you have to ask, you don't know

*

Offline spoon

  • *
  • Posts: 1134
  • Foxy wins
    • View Profile
Re: Use CloudFront for serving static content
« Reply #13 on: December 06, 2013, 11:05:59 PM »
emily is pizaaplanet? ???
inb4 Blanko spoons a literally pizza

Offline emily

  • *
  • Posts: 18
  • Lady Admiral of Reason
    • View Profile
Re: Use CloudFront for serving static content
« Reply #14 on: December 06, 2013, 11:13:21 PM »
emily is pizaaplanet? ???

No pizaaplanet is pizaaplanet.

emily is emily.
If you have to ask, you don't know

*

Offline la xasop

  • Administrator
  • *****
  • Posts: 6338
  • Professional computer somebody
    • View Profile
Re: Use CloudFront for serving static content
« Reply #15 on: December 07, 2013, 02:28:39 AM »
AWS' CDN uses their slower S3 servers - it's more about offloading requests from your servers, rather than actually using faster servers. So if your VPS isn't under strain, it's probably better to leave it like that. Probably better to just focus on preventing your VPS from going down ;)

I wasn't expecting faster servers, only shorter latency. Also, downtime is inevitable. While my VPS is up most of the time, it can't hurt to plan for what happens when it's not.
when you try to mock anyone while also running the flat earth society. Lol

*

Offline Lord Dave

  • *
  • Posts: 5850
  • Grumpy old man.
    • View Profile
Re: Use CloudFront for serving static content
« Reply #16 on: December 07, 2013, 02:34:48 AM »
emily is probably a guy.

 :'(
I honestly thought you were a spambot when I saw your e-mail.

*

Offline la xasop

  • Administrator
  • *****
  • Posts: 6338
  • Professional computer somebody
    • View Profile
Re: Use CloudFront for serving static content
« Reply #17 on: December 07, 2013, 04:29:11 AM »
After trying out various CDNs, I can say that all of the ones which aren't geared for big business suck in one way or another. Incapsula was the closest one I found to being usable for our purposes, but they don't offer IPv6, which I consider to be important.

Therefore, I'll be serving the homepage from my VPS for the time being.
when you try to mock anyone while also running the flat earth society. Lol

*

Offline la xasop

  • Administrator
  • *****
  • Posts: 6338
  • Professional computer somebody
    • View Profile
Re: Use CloudFlare for serving static content
« Reply #18 on: December 07, 2013, 09:15:33 AM »
I decided to run with CloudFlare in the end. The library is now being served via CloudFlare, and the homepage will soon follow suit.
when you try to mock anyone while also running the flat earth society. Lol