When a website is loading slowly, it is often thought that the server on which it is hosted is overloaded, but this is generally not the case. A website hosted on a very powerful server can still load very slowly if it is not optimised or coded properly. Depending on how your website is built, optimising it can be achieved in a number of different ways.

One of the first things you should try when trying to get your website to load quicker is to enable compression on your website content. Enable mod_deflate by adding the following code to the .htaccess file:

<IfModule mod_deflate.c>
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml

  # Remove browser bugs (only needed for really old browsers)
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  Header append Vary User-Agent
</IfModule>

Next to try would be to review the ‘server response time’. As most websites built these days will have its content generated from a database, when someone visits the website it essentially needs to be ‘built’ by the server each time. To speed up this process, you can enable caching on your website. For any content management system such as WordPress or Joomla, there are a number of caching plugins/modules available. We would recommend a caching plugin in almost every case.

If caching is not available or suitable (as it may cause some issues the odd time), you might want to consider a CDN (content delivery network) to cache some of the content aggressively. With LetsHost shared hosting accounts, we offer Cloudflare for free and this offers both caching and a CDN service.

If you require further information/assistance on the above, please submit a ticket and a member of the team will be happy to assist further.