CDN - CloudFlare - Suggestions/Help?

Aussie-Dave

Former AGD Member
Joined
Nov 24, 2007
Messages
684
Reaction score
3
Hi,

Since Google introduced speed as one of its score matrix I've become rather obsessive about increasing page loading speeds. I've commence a new site and it's also host in Australia. By tweaking bits and pieces (WP) I've obtained a 95/100 score.

One of the major issues in Australia is bandwidth. Unlike the USA, UK etc..etc.

derail
EG - I used Steam to purchase games. The fastest speed I can get from OZ is 350Kb/sec (50 miles away). Whereas download from US (LA) I get constant D/L of 1.1Mg/sec (10,000 miles away).
/derail

The thing that slows the site down are images, css and scripts. I've added minify but can't do optimise the images are further or they'll look crappy.

So I've just added cloudflare. However as there are no Australian nodes, everything is served from the US.

When the site loads initially loads there's a 3 sec blank page, then whamo to whole site loads.

Every page after this loads practically instantly.

Have site on a VPS (only site using it):
50GB Disk Space
50GB Bandwidth
2 CPU cores @ 3.2 Ghz
1GB RAM | 1.5GB Burst

What concerns me the site is really only for Australian and New Zealand. With no Austalian cloudflare node/s here...images, scripts and css are served from the USA. Which inevitably will always have many more hops back and forth.

Given the above I feel I'm in a catch 22 and not sure if I should keep cloudflare or if I should see if I can obtain a faster VPS with more throughput of bandwidth speed...Somethnig that ain't throttled or throttled less.

What are your thoughts please?
 
Last edited:

Vladi

Affiliate Guard Dog Member
Joined
Feb 4, 2008
Messages
772
Reaction score
115
I took a look at Cloudflare and it looks like they are doing a lot more than just acting as a CDN. It appears you need to delegate your entire DNS to them? Perhaps that is where the latency is coming from.

I am making the assumption from what I have read that Cloudflare is sitting in the middle now as an intermediary for every request made to your site. If not, ignore the rest of this post.

I have used plain origin-pull CDNs in the past. What that means is that you assign a subdomain or full domain to their servers and anything that you request through that subdomain is "pulled" from your normal domain first and cached. But any requests to your normal "www" domain go straight to your normal server. You are in control of what gets cached by altering img src tags or whatever to be served via the CDN.

The important thing is that Cloudflare says they don't cache non-static content (php, asp pages etc). So you're introducing at least an extra server hop and a bit of extra processing time for every visitor on each page load, like so:

1. Visitor requests page from your site via CF servers.
2. CF checks the request to see if it is malicious.
3. If not, CF then requests the actual page from your server (remember it doesn't cache non-static content).
4. Your server sends the page back to CF.
5. CF relays it and serves the page to the user.
6. User downloads all the static content on the page (images, css, js) directly cached from CF's servers.

vs a regular origin-pull CDN:

1. Visitor requests page from your server.
2. Page is served to the user.
3. User downloads all the static content on the page (images, css, js) directly cached from the CDN, providing you specified the source of the static files to use the CDN.


The benefit Cloudflare are selling is they attempt to filter malicious traffic for you and also they can automatically serve all the static stuff without you having to change your image or css source references. You're trading convenience and protection from spammers for time to serve the page - you need to decide what is worth more.

As for a CDN that has an Australian POP, I know EdgeCast does. They won't sell direct to small sites, so you need to find a host that acts as a reseller and deal with them. From memory SpeedyRails is one (you can get a CDN-only account, you don't need to host with them).
 
Top