Geekflare is supported by our audience. We may earn affiliate commissions from buying links on this site.
In Cloud Computing Last updated: September 6, 2022
Share on:
Invicti Web Application Security Scanner – the only solution that delivers automatic verification of vulnerabilities with Proof-Based Scanning™.

Ensuring your website load faster is one of the critical metrics to online business success.

Nobody likes a slow loading site.

There are various techniques to speed-up your website, but one of the quickest ways is to implement the right CDN (Content Delivery Network).

If you are new to CDN, you may refer to the essential guide to CDN for better understanding.

In one line, CDN accelerates your content and serves the requested resources to the audience from the nearest location. It’s essential to choose the low latency CDN, which has worldwide POP (point of presence) or edge location.

Let’s look at some of the CDN providers and their number of POP.

CDN POP/Edge Network/Cache location
Google Cloud CDN 130+
Cloudflare 200+
Amazon Cloudfront 200+
StackPath 45+

In this post, I will talk about how to enable Google Cloud CDN for your website and set up one WordPress URL to show how fast it is.

Google Cloud CDN is available to anyone using Google HTTP(S) Load Balancer and provides many other features along with low latency content distribution.

  • Anycast – all content distribution from single IP worldwide
  • HTTP/2 – new HTTP 2 protocol is support.
  • HTTPS – setup your SSL/TLS certificate at Load Balancer
  • Logging – Capture cache hits/miss in Stackdriver logging
  • Cache Purge – Purge the cache instantly

Enabling Google Cloud CDN

You can enable CDN on either existing Google Load Balancer or New one.

To enable on existing LB:

  • Log in to Google Cloud Platform to list the Load Balancer.
  • Click Edit
  • Go to the Backend configuration and select the existing backend.
  • Tick the “Enable Cloud CDN” under backend configuration of HTTP(S) load balancer

google-cloud-cdn-existing-lb

  • Click Update to save the configuration.

To create new LB and enable

As an LB pre-requisite, you need to create an instance group. Once the instance group created, you can do the following to create HTTP(S) LB and enable Cloud CDN.

  • Log in to Google Cloud Platform
  • Go to Networking >> Load balancing >> Create a load balancer
  • Select “Start Configuration” for HTTP(S) Load Balancing
  • Create a backend configuration with the existing instance group and select “Enable Cloud CDN.”

Google-lb-cdn

Most probably, you don’t have to do any configuration for (Host and path rules & Front configuration) if you are just doing basic LB setup.

You can leave the default configuration and click Create

google-lb-review

It will take a few seconds, and you will get a confirmation that LB is created. LB will be associated with a public IP which you will use to update A record of your domain.

google-lb-created

Note: Google will, by default, give you an ephemeral IP, and it’s strongly recommended to get one static public IP for the LB.

Testing Google Cloud CDN

So here is what I did to test.

I provisioned f1-micro instance with 10 GB SSD disk on Google Cloud. BTW, this configuration would cost around $6.

I installed WordPress with the help of EasyEngine without any cache plugin and point my domain (Chandan.io) to VM external IP address.

Note: DNS propagation may take some time, so you got to ensure your domain is resolving to Google Cloud VM before starting the test.

I installed the BLOGGING theme, so it has some content.

Testing WordPress without Google Cloud CDN

I ran a speed test against Chandan.io through BlazeMeter with 50 concurrent users for two minutes, and results are:

  • Average response time is 13.46 seconds
  • 90% response time is 26.73 seconds

google-cloud-vm-test

So now, I know my WordPress performance from VM, and it’s time to enable the cloud CDN and run the test again to compare the results.

You may also consider some other tools to perform a load test.

Testing WordPress with Google Cloud CDN

I created LB with Cloud CDN and updated my domain A record to point to LB public IP.

The backend VM remain the same, and I ran the test with 50 users for two minutes, and here are the results.

google-cloud-cdn-test

Do you see a huge difference?

  • Average response time 3.82s compare to 13.46s without CDN.
  • 90% response time 9.6s compare to 26.73s without CDN.
  • Average throughput 10.28 hits per second compared to 3.24 without CDN.

Google Cloud CDN made my website load faster for and increased the throughput. The performance looks promising, and if you’re already on GCP, then you may want to take advantage of their low-latency CDN.

If you are interested in learning GCP then I would suggest checking out this Udemy course.

  • Chandan Kumar
    Author
    As the founder of Geekflare, I’ve helped millions to excel in the digital realm. Passionate about technology, I’m on a mission to explore the world and amplify growth for professionals and businesses alike.
Thanks to our Sponsors
More great readings on Cloud Computing
Power Your Business
Some of the tools and services to help your business grow.
  • Invicti uses the Proof-Based Scanning™ to automatically verify the identified vulnerabilities and generate actionable results within just hours.
    Try Invicti
  • Web scraping, residential proxy, proxy manager, web unlocker, search engine crawler, and all you need to collect web data.
    Try Brightdata
  • Monday.com is an all-in-one work OS to help you manage projects, tasks, work, sales, CRM, operations, workflows, and more.
    Try Monday
  • Intruder is an online vulnerability scanner that finds cyber security weaknesses in your infrastructure, to avoid costly data breaches.
    Try Intruder