How can I improve the performance of my website

5
(1)

Loading time is the total time needed to present the website to visitors, you can improve website performance. Therefore, a website that takes more time to be displayed to users tends to lose visitors and conversions, resulting in a high bounce rate. Therefore, not only with an increase in website performance from an SEO point of view, a better customer acquisition can be achieved.

Here are the basic ways to improve the performance of a website. By caching on a few technologies, speed and overall performance can be significantly improved for most websites, increasing the so-called online experience.

Reasons for poor website performance

  • Poorly coded HTML, CSS, JAVA code
  • Unoptimalizing images or videos or video links in content
  • Forwarders
  • Improper cache handling
  • Server Hosting
  • Increased blocking time
  • More time for interactions – CLS, TBT, LCP
  • Unused or Heavy Plugins

How to Improve Website Performance

Is it still the right web hosting plan?

Most website owners initially choose a hosting plan to get started. These hosting plans are very simple, inexpensive and beginner friendly, if the website does not develop further, this hosting plan can fit perfectly. But if progressive content is to be offered, the site will eventually grow, and thus will achieve ever longer response times. If this is the case, the best decision is to update the web hosting plan. Then users will be satisfied, search engine optimization (SEO) will remain strong and the website can continue to grow and change.

Clean up excessive and heavy plugins

An excess of plugins tends to make administration difficult and confusing. This can reduce the stacking speed of the website and can also accidentally result in security vulnerabilities that can be misused by attackers to gain access to the website’s backend. It is generally recommended to use as few plugins as possible, if installed plugins are no longer used, they should be uninstalled.

Is the Website Theme still the right one?

The topic of a website can also affect the loading speed of the page. Regardless of how well or poorly adjusted the server configuration is, if the website theme has complicated code, the website will remain sluggish.

Enable GZIP compression

By activating GNU Zip, GZIP for short, a website will perform well in terms of loading time and speed, GZIP compresses the web pages on the server side and sends them to the users’ browser. These files, in turn, are decompressed and provided by the browser as a result of the user’s request.

It can help reduce the size of the web pages, which can significantly reduce the time it takes to download the asset, reduce information usage for the user, and shorten the ability to render the pages.

Using Content Delivery Network (CDN)

The main purpose of using a CDN is to improve the user experience and increase the performance of the website by distributing the content to shorten the path to the browser client. CDNs not only ensure faster loading in the browser, but also help to avoid the inaccessibility of a website in the event of traffic floods or regional disruptions. CDN service providers such as Cloudflare also offer protection against DDoS attacks and other free and non-free services. Customized proxy services are offered for WordPress that can be used with most cache plugins.

Which CMS should I choose?

A website is at the heart of an internet marketing strategy and the CMS is the heart of the website. A CMS organizes everything to update and change the content of the website. WordPress is the well-known and most reliable CMS par excellence, but content management systems such as Typo3 and Joomla have also established themselves and enjoy a broad following.

Improve Performance by enable website caching

Website caching is one of the most useful technologies available. While the technology and exact details of caching can be quite complex, the underlying idea is simple. Let me say here an example.

To the question, what is the result of 5 x 5, you know, the answer is 25. You don’t need to calculate it, we’ve done this multiplication so many times in life that we don’t need it anymore – we just remember the result without having to do any mental processing. Well, that’s how caching works.

Websites are generally viewed hundreds, thousands, or sometimes even millions of times a month. Typically, the server has to perform a series of complex (and time-consuming) calculations every time a browser requests a web page. It retrieves the latest posts, generates the header and footer, finds the site’s sidebar widgets, and so on. However, in many cases, the result of all these calculations will be exactly the same. Wouldn’t it be great if we could just get the server to remember the end result instead of processing each request individually? That’s exactly what caching does!

When caching is activated, the server stores this HTML file – usually in its “random access memory” (RAM), which is very fast. The next time a visitor visits the web page, the server does not need to perform processing with SQL queries and conversion to HTML. Instead, it simply sends the already prepared HTML file to the browser.

Caching in WordPress

For WordPress, use efficient code, use cache plugins, or use the host’s built-in cache, but not both. The most important rule of all, never (NEVER) use more than one cache plugin. This will not make the website any faster; it will probably even slow down the site.

Always use a single cache plugin. If configured correctly, it will help speed up the site considerably. The best cache plugins are WP Rocket, W3 Total Cache, WP Fastest Cache (figure), and WP Super Cache, this is from the WordPress development team itself.

improve website performance using WordPress Cache Plugin
Figure: WP Fastest Cache

Improve website performance using the host’s cache

This applies to websites that run in managed WordPress hosting environments that provide caching mechanisms (and other services), like an Apache or Nginx Webserver.

Caching systems used by hosting providers operate at a much lower level than WordPress plugins, which means they are much more effective. In addition, they are also specifically tailored to work with WordPress and the hosting environment used, which further increases their usefulness.

If you’re using a managed WordPress host, it’s a good thing not to use a caching plugin at all. In fact, many hosting providers even prohibit the use of certain cache plugins because they are likely to interfere with the specific caching systems that have already been implemented.

Using Apache 2.4 cache on Debian 10

If you have a web server on your own virtual machine, or using a dedicated root server as a tenant, you’re well equipped with Debian or Ubuntu, or also with CentOS, where a server with 4 GB RAM and 10 GB DISK already brings luxurious conditions to use the cache optimally, the configuration is described here.

The responsible Apache module for compression is mod_deflate, it allows the compression of the output at the web server before it is sent to the client (browser). Faster page deployment isn’t the only benefit of compression. When search engines rate a site, the lower bandwidth usage found with mod_deflate is taken into account because search engines evaluate the site’s performance.

How to activate mod_deflate?

Here I will demonstrate it with a Debian 10 (buster), but of course this applies to any Apache 2.4 web server running on any Linux distribution. If you enter the following command in a terminal for a Debian, the output will look something like this.

$ sudo a2enmod deflate
Considering dependency filter for deflate:
Module filter already enabled
Module deflate already enabled

The check of the activated compression (mod_deflate) goes as follows, from now on I am root with sudo su -

$ apachectl -t -D DUMP_MODULES | grep deflate
 deflate_module (shared)

The Apache Mime Type directives are entered and activated on most distributions. The default configuration is set up to compress HTML, CSS, XML, RSS, and Javascript.

$ vi /etc/apache2/mods-enabled/deflate.conf
<IfModule mod_deflate.c>
        <IfModule mod_filter.c>
                AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
                AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
                AddOutputFilterByType DEFLATE application/rss+xml
                AddOutputFilterByType DEFLATE application/xml
                AddOutputFilterByType DEFLATE image/x-icon image/svg+xml
        </IfModule>
</IfModule>
DeflateCompressionLevel 7
DeflateMemLevel 8
DeflateWindowSize 10

These entries can also be entered in the docroot of the website in the .htaccess file, provided that in the Apache virtual host configuration (VirtualHost) allows overwriting with AllowOverride ALL. If VI iMproved is too crude for you, you will probably use nano as your preferred editor.

Compression level options:

  • DeflateCompressionLevel = Specifies the compression level of the file between 1 and 9 (1 is the lowest compression level)
  • DeflateMemLevel = Specifies how much memory zlib should use for compression
  • DeflateWindowSize = Specifies the size of the Zlib compression window (6 -15)

  By default (and without configuration), mod_deflate has the values for CompressionLevel 7, MemLevel 8, and WindowSize 9. When setting these options to their maximum values, this does not seem to be the most efficient use of mod_deflate, the processes could consume too much system resources and affect the performance of the web server. Too high a value can significantly increase server utilization, and ultimately slow down performance again, depending on the server’s capacity with number of vCPU and RAM, the optimal ratio can vary and should be determined.

After editing, the Apache change must still be activated.

$ systemctl reload apache2

Testing mod_deflate

We will test the reconfigured module to make sure it works. On the server you just configured, download the JQuery Javascript file with the following 3 steps.

  1. Open a terminal to the web server
  2. Go to the document root of the web server with the command
    cd /var/www/html
  3. Download the .js file using the
    sudo wget http://code.jquery.com/jquery-3.2.1.js

The jquery-3.2.1.js file has a size of 268039 (Uncompressed), this file size we will compare later.

Now log in to another Linux host that is in the same subnet, open a terminal and run the following command.

$ wget --header="Accept-Encoding: gzip" http://IP_ADDRESS/jquery-3.2.1.js

The IP of the web server is IP_ADDRESS with the file jquery-3.2.1.js just downloaded.

During the download, you should see that the file size is less than half the size of the original file. In this case (Figure: jquery) to compare, the download size was 101.84 KB.

Figure: jquery

Conclusion

The Apache web server now performs an efficient compression level without affecting the performance of the server. This is an easy-to-implement compression that can give the web server a serious boost to improve website performance. Play around with the configuration options to find out which compression levels bring the best performance for the Apache web server and website.

GTmetrix provide also site performance testing.

Performance Report by GTmetrix.com

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

Leave a Reply

Your email address will not be published. Required fields are marked *