CDN and caching


#1

Hi, I’m very new to the overall concept of a CDN. Right now I have a site, https://akhawaii.com that is hosted by 1and1. I’ve been trying to enable caching on the site, but apparently its an issue with 1and1’s servers that is going to take some time to address. I’ve been using Google’s pagespeed insights to verify the results. Does a CDN host the site on its own server and therefore enabling cache on the CDN would show on pagespeed insights? Also what factors determine if a user hits the CDN version of the site or the original host? Or am I completely wrong and a CDN just hosts certain files from the site?


#2

Cloudflare is kind of like a CDN. Cloudflare pulls content from your server and delivers it to your visitor. A casual glance at a Page Test site isn’t going to reveal much, as all your hosted content is delivered from the same URL. Many filetypes are cached (see below). A check at webpagetest.org can show you more. If you click on Details and look at Server Response for some of the files, you’ll see a CF Cache Status on eligible files that will let you know if it’s cached or not.

I see two hitches: You’re pulling from a bunch of external resources, and that adds some overhead Cloudflare can’t compensate for. You also have Rocket Loader turned on. This is mostly unnecessary, as you have HTTP/2 enabled, which eliminates the need to try to bundle resources together.

I’d also install a WordPress cache plugin. This should speed up your initial page query (Time To First Byte) by pre-generating your home page. I prefer WP Fastest Cache, but there are others like W3 Total Cache, etc.

The video section is also a a hefty load. At 10 megs, it could use some scaling down and compressing – it’s full HD. And as an mp4, it’s not cached. I’d add a page rule for that file alone (https://akhawaii.com/wp-content/uploads/2017/10/Produce_0.mp4) and set it to Cache Everything with an Edge TTL of a month and hope that helps speed things up.