Optimizing your website to improve page loading time and resource usage

Posted on Sep 1, 2017


Having a fast website is essential if you want to provide your visitors with great user experience and rank well in search engines like Google and Bing, which take the loading speed of your pages into consideration. However, there are many factors that can negatively affect a website’s load time and performance and one of the most common reasons is application/development problems – your website’s code is not optimized and requires more time and resources to be executed – resulting in poor overall website responsiveness and performance.

In this article, we will try to explain the technical details while at the same time provide you with easy-to-follow instructions and useful alternatives that you can start implementing right away to improve your website’s performance.

NOTE:  Before you make any changes or optimization to your website, we strongly recommend you perform a full website backup. Many of the suggestions and tips in this article involves the modification of your website in live setting. You will want to back up your website and database just to sure that if anything goes wrong, that you have a fully working copy available to minimize site disruption.

Identifying critical issues

The pursuit for an optimized website begins with identifying critical application and development issues. Page speed testing tools powered by Google and Yahoo, and website monitoring specialists Pingdom and GTMetrix can give you valuable analyses, insights and suggestions.

These tools use various browsers across various geographic locations to load your website and replicate end-user website experience. Performance bottlenecks are examined and monitored across various elements such as file size, load time, response time and requests pertaining to various parts of your website (such as JavaScript, CSS files, HTML, images, etc.).

You can also use the CPU and Concurrent Connection Usage feature in your cPanel. The feature is a resource monitoring tool that lets you view detailed information about problematic processes and database queries running on your account. The information can help you determine why a resource limit was triggered.

 

Image Optimization

While a large, high-quality image improves the overall aesthetics of a website, it can adversely impact the performance of your website, especially if the image is un-optimized. Un-optimized images are generally very heavy, and as a result use a lot of server resources and take longer to load.

Some image optimization tips:

  1. Eliminate unnecessary images

The first question you need to ask yourself is whether an image is required to achieve the effect you are after. Keep the number of images to an absolute minimum and consider if there is an alternative technology that could deliver the desired results but in a more efficient way. For example, you can replace text-in-images with web fonts to add beautiful typefaces to your website.

  1. Select the right image format

Start by selecting the universally supported image formats: JPG, PNG and GIF.

  • Do you need animation? If so, GIF is the only universal choice.
  • Do you need to preserve fine detail with highest resolution? If so, use PNG.
  • If you do not need animation and/or image preservation is not a priority, then use JPG.
  1. Reduce the size of your image files

You might think larger images means a great user experience enhancement. It is, but you have to be careful because large images take longer to load. Also, simply shrinking the dimensions of a large image via the source code is not an effective way to reduce the size of your images.

If you use Photoshop, you can reduce image file size by using the “Save for Web” command in Adobe Photoshop. If you are using Photoshop CC, the “Save for Web” command is found under File > Export.

When using this command, you want to adjust the image to the lowest file size acceptable without compromising the quality of the image.

If you don’t have Adobe Photoshop, there are many other tools online and offline you can use to edit your images.

Online tools:

Offline tools:

WordPress Plugins:

Optimize code and delivery

When it comes to your website files, optimization is not all about minimizing file sizes.  Reducing the number of client-server requests in delivering website content is also an integral part of website optimization, and one way of doing so is to enable browser caching. Browser caching allows your website visitors to store a version of your website on their browser until your website is updated, or until you instruct it to refresh.

There are different ways to enable website caching. For example, if you are using WordPress, you can consider the following plugins:

Joomla and Drupal both come with a built-in caching feature.

If you are not using WordPress or a CMS, you can consider minifying your JavaScript and CSS files. Minifying involves removing all unnecessary characters (ie. whitespace and comments) from the source files.

Choosing your WordPress theme

When choosing a theme for your WordPress website, make sure you also consider performance and not just aesthetics – some themes may look beautiful but are bloated with crappy codes.

Always use a well-coded theme that is developed by a reputable company. If in doubt, consider using the prepacked themes that come with your WordPress installation. These themes are coded by WordPress.org. A new theme is released each year and is named accordingly, but if you can, choose the most recent theme available as it is typically written with the most up-to-date standards.

Also, make sure you always keep your theme updated. Notifications to update your theme will appear in your WordPress dashboard when available.

Install quality plugins

Yes, you can have too many plugins. Plugins are designed to add features or functionality to your website, but at the same time, using too many plugins overloads the server.

Before you add a plugin to your website, consider these:

  • Does it load lots of scripts?
  • Does it add extra database queries to each page?
  • Does it perform complex operations?
  • Does it perform remote requests, ie. external APIs?

If you are not 100% sure, you can use a WordPress-monitoring plugin to monitor the resource usage of your WordPress Installation (themes, plugins and codes). Some recommended resource monitoring plugins are UsageDD, Performance Profiler and WordPress Inspector.

Here are some plugins that are known to be resource-hungry and will overload a server:

Related Post plugins:

  • Contextual Related Posts
  • Yet Another Related Posts

Alternatives: Jetpack

SEO plugins:

  • SEO Auto Links & Related Posts
  • Broken Link Checker
  • Fuzzy SEO Booster
  • Google Sitemap Generator
  • Google XML Sitemaps with Multisite Support

Alternatives: Google Analytics, Yoast SEO

Statistics plugins:

  • WP-PostViews

Alternatives: Google Analytics, JetPack

Security plugins:

  • WordFence

Alternatives: WP Security and Firewall, Bulletproof Security

NOTE: Wordfence is a very powerful security plugin. However, it is also very resource-intensive. If you wish to continue using WordFence, you will need to tweak some of the options to limit the resources consumed. Please refer to Wordfence’s options page for recommendations.

Other/misc. plugins:

  • NextGEN Gallery
  • Disqus Comment System
  • Contact Form 7
  • WooCommerce

And just like themes, make sure you always keep your plugins updated. Notifications to update your plugins will appear in your WordPress dashboard when available.

Remove unused plugins, themes and media

There is no good reason to leave unused plugins, themes and media in your WordPress installation. It is strongly recommended that you remove them for two main reasons:

  1. Security – Plugins and themes are subject to vulnerabilities. If the plugin or theme developer is not issuing updates, your website is vulnerable.
  2. Disk space – Unused plugins, themes and media take up disk space. They will slow down your backup process and increase the size of your backup file.

If you have plugins that are not currently used on your website, but you do not wish to remove them, you should at the very least disable them, especially plugins that:

  • Collect and provide statistics (ie. Wordfence live traffic reports)
  • run ongoing scans (ie. Broken Link Checker runs ongoing scans)
  • send admin or email notifications (ie. chat and calendar plugins)
  • pull resources from external websites
  • stores tons of data (ie. related post or popular post plugins)

Optimize your WordPress options and settings

In addition to optimizing plugins and themes, there are a lot of optimizations you can do to improve the efficiency and performance of your WordPress website. One optimization is to disable unused WordPress settings, such as pingbacks, trackbacks, emojis and others. You can easily manage all these WordPress settings and options with the WP-Disable plugin.

Once installed, you will see the Optimisation tab on your WordPress menu dashboard. It opens the WordPress Disable interface where you can manage many WordPress options and settings.

And of course, you should always use the latest version of WordPress, or any application(s) that you use on your website (ie. Joomla, Drupal, Magento, etc.). Security is hands down the most important reason why you should keep your website up to date. In addition, each new release, the developers address bug issues, add new features, improve performance, and enhance existing features to stay up-to-day with new industry standards.

Optimize your database using phpMyAdmin

Unoptimized databases and tables can overload the server. In fact, unoptimized data tables consume more CPU.

We recommend using phyMyAdmin to optimize your database. Typically, you will only see noticeable results if you have a large database (ie. over 10,000 rows or over 500MB in size). But it is still good practice to optimize your database, regardless of its size.

Make sure you select all tables within the database when optimizing.

There will also be times when a database is corrupted due to software defects or hardware issues. You should also use phpMyAdmin to repair database tables to make sure they are working properly and efficiently.

There are also plugins you can install to optimize your WordPress database. One popular plugin is WP-Optimize. When installed. this plugin will automatically clean your WordPress database by removing all unnecessary data, compact your tables and more so tat it runs at maximum efficiency. Another popular plugin is WP Rocket.

Limit automated scripts and scheduled tasks

If you have any automated scripts or applications (ie. a cron job) running on your website you might want to set these to run once per week at most and to schedule these for off-peak hours.

For example, while a cron job saves you time, running resource-intensive cron jobs too frequently can cause problems with your server performance. We recommend that cron jobs are ran only as often as necessary. If a data backup or other maintenance tasks are causing high CPU usage then you should temporarily disable it.

You also need to pay attention to applications that have their own scheduling scripts. For example, the WordPress cron job is a resource intensive task that runs every single time your WordPress is accessed. You might want to disable the wp-cron.php to reduce the overall resource usage and improve the efficiency of your website. We strongly recommend you disable the cron jobs on these applications and set up a normal cron job through cPanel instead.

Same goes for automated backup scripts or plugins. You will be better off using the Backup function in cPanel. You can find backup tools under the Files as well as within the Softaculous Auto-Installer in cPanel. We also have an optional site backup service for clients – our system will generate backups of your website and store them onto a separate backup server. This ensures that you have a proper backup of your website and it is not using up any of your account’s resources. The Site Backup Service can be ordered through your Doteasy Member Zone.

Limit search engine crawlers

While you want search engine bots and spiders to crawl and index your website, excessive and uncontrolled crawler traffic and activities can cause high resource usage. Automated bots crawl from the front page and spider out to every link on your website in order to accurately locate all content on your website. This results in an excessive amount of resource usage.

You can control robots by implementing a robots.txt file. A robots.txt file is a simply text file placed in the root directory of your website that tells search engine crawlers if they should access a file or not.

By adding the crawl-delay rule to your robots.txt file, you can slow down the search engine crawlers. Adjusting the crawl rate won’t affect your ranking, just how long it takes the bots to index your entire website. Yahoo! and Bing supports the crawl-rate directive. Unfortunately, Googlebots are known to not follow the crawl-delay rules in robots.txt files. To change the Googlebot crawl rate, please refer to Google’s documentation.

Make sure you place your robots.txt in the root directory (the public_html folder on your account).

Optimize website with cPanel

Your cPanel comes with the Optimize Website feature that allows you to enhance your website’s performance by compressing certain types of files. For bandwidth intensive websites, using this feature can offer a benefit, as the server is compressing data before sending it you will be using less bandwidth.

Scalability Issues

If you have implemented the above suggestions and you are still not seeing noticeable results or improvements on your website’s performance, then you have probably encountered a scalability problem – your website needs have outgrown the capabilities of your hosting plan. The best solution in this case would be to upgrade your hosting services to a plan that offers more resources such as CPU, memory, higher I/O speed, etc. But before you jump into a cloud or a dedicated hosting plan, there are still many levels of advanced shared hosting plans Doteasy offers that you should consider.

For example, we have recently introduced a new hosting plan that is geared towards content intensive websites, such as eCommerce, rich multimedia, social networking, document archival, and high-definition image-heavy websites. The hosting plan is made up of three different tiers, all comes with SSD storage, more server resources (ie. CPU, memory, higher I/O speed, etc.), daily site backup, enhanced email spam protection, as well as dedicated IP and domain SSL.

For more information about the new Doteasy Business Hosting plans, please visit our website: http://www.doteasy.com/business-hosting/. Or, you can also connect with us via email or Live Chat – we will be happy to answer any questions you might have or offer additional options and tips that are more specific to your website needs.

Comments

comments