net - UK (2020-05)

(Antfer) #1

PROJECTS
WordPress


PageSpeed is a complex topic and is becoming more and
more desirable in the field of web development. Here are a
few resources to help you get ahead.

web.dev
https://web.dev/fast
This Google website is full of fantastic guides going deeper into the
subject than this tutorial has space to do.

Cloudflare
http://www.cloudflare.com/en-gb
Cloudflare contains various tools for speeding up a website, from
a content delivery network, to attack prevention and caching, even
the free tier will take a huge amount of load off a server.

Breeze
https://wordpress.org/plugins/breeze
This is a multipurpose caching plugin for WordPress made by the
hosting provider Cloudways. This plugin contains all the main tools
that are needed to optimise a modern WordPress website with
minimal bloat.

BunnyCDN
https://bunnycdn.com
A content delivery network that works great with both WordPress
and the Breeze plugin. Accounts are paid but costs are minimal and
can be topped up as you go, rather than autobilled.

GET PAGESPEED HELP


RESOURCES

Advanced options. First, identify any JavaScript
files loading on the page that are not critical to how
the site functions or looks. Then enter the original
unminified URL of the resource in the ‘JS files with
deferred loading’ box and save the changes. This
should force the file to only run once the page has
finished loading.
More critical scripts can still be optimised by using
the Async attribute. This fetches the script while the
page is still rendering for a user and then executes it,
interrupting the DOM if necessary.

BROWSER CACHING
Once an image, stylesheet or script has been
downloaded by a user, in most cases that asset is
unlikely to change by the time they open a new page
or return to the website within a short period of
time. To take advantage of this, browser caching can
be used.

TUNE THE SERVER
WordPress websites that involve search features or
the popular ecommerce plugin Woocommerce can
be quite CPU intensive at high user counts. To help
with this, it is worth increasing the raw power of the
server. Increasing the CPU and RAM available to the
server will take care of this.
Like most web apps, if the server running a
WordPress website runs low on RAM it will begin to
slow before crashing entirely. Usually, MySQL will
fail first causing an ‘error establishing database
connection’ error.
Cloudflare (www.cloudflare.com/en-gb) is a service
that, among other things, screens traffic before it
even gets to your website. The free plan can help
massively in reducing bandwidth and server power
wasted on bots and spammers.

CONTENT DELIVERY NETWORK
CDN stands for Content Delivery Network and
helps to reduce server load as much as possible by
offloading scripts and images to specialised servers
close to users and designed to deal with these types
of files. Setting a CDN up will take seconds off page
load time and is relatively inexpensive. BunnyCDN
(bunnycdn.com) is easy to use and cost effective, it
also works great with the Breeze plugin used so far.

SET UP A CDN
To set up a CDN with BunnyCDN, first sign up for an
account on the website and load the account up with
credits – start with $10, which should last several
months for a mid-traffic site.
First, a ‘pullzone’ is needed – click ‘Create a
pullzone’ in the BunnyCDN dashboard. Enter a name

“A C o n t e n t D e l i v e r y N e t w o r k


helps to reduce server load as


much as possible by


rl·rdglqj#vfulswv#dqg#lpdjhv#


to specialised servers”

Free download pdf