Speed ​​up WordPress & optimize website for speed – Part 2

Step 4: Enable Google's Brotli Compression

In addition to minimizing the size of files, you can also benefit from a special type of compression called Gzip or Brotli. Basically, whenever someone visits your website, the resources (files) from your server will be found and downloaded. The larger the resources, the more time it takes to download to the visitor's machine. By enabling Gzip or Brotli compression, you can significantly reduce the size of these resources and speed up the loading process of WordPress, which in turn also helps in speeding up WordPress.

Google's Brotli compression algorithm seems to be more efficient than Gzip in terms of size

To use Brotli, your root server needs to be enabled. Since Brotli is very new, not every browser supports it. However, you can set up the return method so that when it encounters a browser that supports it, it will use Brotli. If not supported, it will access Gzip's resources.

Like GZIP, Brotli can only be used to compress HTML, CSS, JavaScript, and other text-based files. If you try to compress binary files, such as JPEGs and MP4s, you will experience an increase in file size. Sitepoint has an in-depth article on how to deploy Brotli on a server and evaluate the impact of Brotli compression on a WordPress site.

To check if your website has Gzip compression enabled, use checkgzipcompression.com. If not enabled, add the following code to your .htaccess file to enable this feature:

<IfModule mod_deflate.c>

  AddOutputFilterByType DEFLATE text/html

  AddOutputFilterByType DEFLATE text/css

  AddOutputFilterByType DEFLATE text/javascript

  AddOutputFilterByType DEFLATE text/xml

  AddOutputFilterByType DEFLATE text/plain

  AddOutputFilterByType DEFLATE image/x-icon

  AddOutputFilterByType DEFLATE image/svg+xml

  AddOutputFilterByType DEFLATE application/rss+xml

  AddOutputFilterByType DEFLATE application/javascript

  AddOutputFilterByType DEFLATE application/x-javascript

  AddOutputFilterByType DEFLATE application/xml

  AddOutputFilterByType DEFLATE application/xhtml+xml

  AddOutputFilterByType DEFLATE application/x-font  

  AddOutputFilterByType DEFLATE application/x-font-truetype  

  AddOutputFilterByType DEFLATE application/x-font-ttf  

  AddOutputFilterByType DEFLATE application/x-font-otf

  AddOutputFilterByType DEFLATE application/x-font-opentype

  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject

  AddOutputFilterByType DEFLATE font/ttf

  AddOutputFilterByType DEFLATE font/otf

  AddOutputFilterByType DEFLATE font/opentype

# For Older Browsers Which Can't Handle Compression

  BrowserMatch ^Mozilla/4 gzip-only-text/html

  BrowserMatch ^Mozilla/4\.0[678] no-gzip

  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

</IfModule>

You can also refer to our detailed guide on Gzip compression at this link. Plugins like WP-Rocket can also automatically enable Gzip compression on your website.

Step 5: Optimize images by compressing or using the latest image technology WebP

Due to the "static" nature of the image, the use of high-resolution images greatly affects the bandwidth and speed of the website. Image formats like JPEGs and GIFs also slow down websites due to their size. Now with new formats such as FLIF, WebP and HEIF have used the latest compression technology to help use high-quality images with smaller sizes. So, if possible, converting images to these formats will immediately improve the speed of your website.

The problem is that not all browsers currently support them, so you have to provide an alternative format for some users. But WebP is actually already supported by a lot of browsers, and other browsers also promise to support it in the future. If you want to test which browsers are supporting these image formats, immediately refer to the Can I Use tool?

If you are not ready to use the new format, then make sure that when using the old format, do not forget to compress the images for optimal results.

This doesn't mean you have to give up high-quality images in favor of low-quality images to speed up your website. There are many ways to optimize the images on your website. Plugins Smush Image Compression and Optimization has a convenient solution to optimize images without losing image quality.

Step 6: Divide the long post into pages

Another buzzword that you may come across when looking for ways to optimize WordPress is pagination. Simply break large pieces of content into smaller chunks. These sections can then be displayed page by page as separate pages.

Pagination is often used for the comments section of a web page, where there can be thousands of comments and concurrently congesting bandwidth. You can easily enable pagination in WordPress comments – just navigate to Settings > Discussions. Here, you can define the maximum number of comments per page. Adjust accordingly because visitors won't want to keep clicking to go to the next page.

In addition to the comments section, pagination can also help you separate a post/page into separate web pages. This can be very useful for long articles because users won't be overwhelmed as soon as they get there. Post paging can be enabled by adding <!-nextpage-> to the text version of the article. At this point, WordPress will automatically detect and activate it for you.

Step 7: Upgrade PHP version to speed up WordPress

This is one of the lesser-known tricks. However, it has the strongest effects. Moving from PHP 5 to PHP 7 offers many practical benefits. WordPress has a 2x performance boost on PHP 7 compared to PHP 5, being able to handle 112% of requests/second. Furthermore, WordPress will also benefit from PHP 7's memory optimization which results in a 30-50% WordPress speedup. That's why PHP 7 is set by default on all Shared Hosting plans and gives WordPress over a 5x performance boost.

However, it's important to keep in mind that PHP 7 lacks backward compatibility. This means that you will not be able to use some plugins/themes, including those that run well on PHP 5. To check if your website currently contains such plugins/themes use the tool. compatibility checker (PHP Compatibility Checker) for WordPress.

Step 8: Use Caching Plugins

Caching is a well-known mechanism to offload some of the burdens on the webserver. Basically, caching engines store frequently used information on the visitor's machine (browser, memory) so that the browser doesn't have to get this information repeatedly from the server. Caching can significantly improve website performance and is, therefore, one of the most important techniques to implement a WordPress speed boost.

There are many plugins for WordPress that perform different types of caching including WP-Rocket and W3 Total Cache. You can also refer to the WP Super Cache tutorial to enable caching for WordPress.

Step 9: Use CDN (Content Delivery Network)

With internet speeds getting faster and faster, it's sometimes easy to forget that websites are located on physical servers far from your location. At this point, the gap can be so large that it adversely affects the response time. Most websites deal with this through a content delivery network (CDN).

When you enable a CDN on a website, the visitor's browser no longer has to reload all the pages from the web server, instead, some static pages are forced to host in data centers near the location. of more visitors. This reduces the total number of requests handled by the web server, thus successfully optimizing WordPress speed.

CDNs can also reduce the load on CPU and resources from the origin server so that the server is not affected when there is a "spike load". So having a CDN protects you from high-bandwidth scenarios, resulting in a smooth experience for each visitor. If one server goes down, the CDN will automatically redirect traffic to another POP point. POP stands for Point of Presences, the site's cached resource point, which is scattered everywhere, to bring resources to nearby users.

Using a CDN is also an advantage of SEO. Google and other engines value website speed to calculate rankings. So if your website is faster, your ranking will be closer to the top of the search page. In addition, CDNs also make your photos and media files easier to scan and appear more likely on Google Image.

If you install the CDN right from the start, your website will be able to scale more easily. Because commercial CDNs take speed first. A reliable CDN provider will make you worry about web optimization no more. In addition, CDN also makes it easier to deploy HTTP/2 and deliver content over HTTPS. In short, choosing a CDN to use is an important step in improving and optimizing your WordPress website.

There are many choices for a CDN. The most popular include CloudFlare and MaxCDN. We have also provided detailed instructions on setting up CloudFlare for your WordPress site.

Step 9: Use CDN (Content Delivery Network)

With internet speeds getting faster and faster, it's sometimes easy to forget that websites are located on physical servers far from your location. At this point, the gap can be so large that it adversely affects the response time. Most websites deal with this through a content delivery network (CDN).

When you enable a CDN on a website, the visitor's browser no longer has to reload all the pages from the web server, instead, some static pages are forced to host in data centers near the location. of more visitors. This reduces the total number of requests handled by the web server, thus successfully optimizing WordPress speed.

CDNs can also reduce the load on CPU and resources from the origin server so that the server is not affected when there is a "spike load". So having a CDN protects you from high-bandwidth scenarios, resulting in a smooth experience for each visitor. If one server goes down, the CDN will automatically redirect traffic to another POP point. POP stands for Point of Presences, the site's cached resource point, which is scattered everywhere, to bring resources to nearby users.

Using a CDN is also an advantage of SEO. Google and other engines value website speed to calculate rankings. So if your website is faster, your ranking will be closer to the top of the search page. In addition, CDNs also make your photos and media files easier to scan and appear more likely on Google Image.

If you install the CDN right from the start, your website will be able to scale more easily. Because commercial CDNs take speed first. A reliable CDN provider will make you worry about web optimization no more. In addition, CDN also makes it easier to deploy HTTP/2 and deliver content over HTTPS. In short, choosing a CDN to use is an important step in improving and optimizing your WordPress website.

There are many choices for a CDN. The most popular include CloudFlare and MaxCDN. We have also provided detailed instructions on setting up CloudFlare for your WordPress site.

Going into the future with WordPress

Websites that are able to adapt to the latest technologies will often last for the next decade. So, successful developers are often the ones who appreciate change.

Keeping an eye on new WordPress updates, plugin updates, and trends I optimize my website to stay ahead of the game. Optimizing WordPress speed can be difficult at first, but with the above 9 fairly simple steps, you have an immediate competitive advantage over your competitors.

For more WordPress tips and tricks, as well as in-depth tutorials on speeding up WordPress, visit our WordPress Tutorials section.