Helping clients succeed on the internet since 1999

At your Service

There's no need to know how the internet works when you have the team at COOLCOM working with you. From simple domain help to advice on complex applications, you'll find every base covered under one friendly roof. 

Blog: The Coder Corner

Dear Hosting Company, My Site is SLOOWWW!

While there is some truth in the fact that as a shared hosting client you are on a server with limited resources, this is not often the reason for a slow site.

Take a look at my own site

The first posts on this site were horribly slow, back in 2010. Back then everything was slower, including the internet connections. But I was decidedly unhappy with the speed of my site. As it turned out, the images I was uploading were a "tad" on the voluminous side. 4-5MB per image, having 10 images on the front page. The site took a long time to load.

Getting in an individual post left the same impression of non-existent speed. So I did what every self respecting client would do: I went to yell at my hosting company. At the time, that was not with Coolcom, they told me to subscribe to a bigger, more expensive package. That would solve all my problems, they said. After an upgrade of the account (a mere click on a checkbox on their end) showed a slight increase in speed on my site. Hardly worth paying 80% more for.

So I called them again, and I got the same answer again: "Upgrade to a bigger package and everything will be smooth.". Since I had heard that before, I decided to check on the internet to see what could be done. There were lots of tips around on how to increase the speed on my site.

Fast forward to today.

I transferred my hosting to Coolcom. I still have my photography blogging site and I still post every week or so. But today that site is fast. Way faster than back in 2010.

In part that will be because the servers at Coolcom are faster. Yet something kept nagging me in the back of my head.

Would I be able to increase the speed again using some simple tactics? Absolutely. So I added my own (site-level) improvements and now the site is running fast.

So what needs to be done to help your site increase load time speed?

First off, the servers at Coolcom provide all kinds of speed increasing services. However, your site needs to take advantage of that. Joomla or Wordpress are great systems, but by default they do not use these services.

1. Ask for GZipped content delivery. That compresses the content before it arrives in a browser. Any browser today knows what to do with that and the increase in speed is immediate.

2. Next is to allow for browser-side caching. By default that is turned off. However, I like to fine-tune it on my end, making sure that only the content that needs to be cached is indeed cached. A shopping cart needs no caching at all, for example.

3. Then came the big change. All images must be compressed and posted at the size you want shown on your site. By simply uploading an image as is, the browser is forced to resize on the fly to deliver smaller images. Photoshop, GIMP, Lightroom etc are good at this, MS Paintbrush is not.

Serving the images at their final size is an immense boost in performance, more so than any other setting.

If you want to know what those settings are, here are mine:

In .htaccess (by now you should know that that file resides in the root of your site) I added this:

<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/
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

Header append Vary User-Agent

This compresses any files that need no changes, so not the content, just the static files served by your theme or template. This is the GZipped part of the optimization. Later I saw that Joomla implements this from inside the administration section, so I could remove this from the .htaccess file altogether. If you don't use Joomla, this might be required to get gzipped content to your visitors.

Now for the caching:

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"

You can adjust the time you want to cache certain file types yourself. I find this one fits me perfectly.

A site that measures the improvements you make on your site is The first grade your site will get is probably quite low. Adding the above tweaks will quickly improve the grade.

Don't try to get a full A for your site, there will always be things that can be better.

GTMetrix will penalize you for not optimizing a few image files that don't belong to you (template/theme images, logos etc) Don't sweat it, just concentrate on your own stuff.

Some of the improvements GTMetrix wants you to implement are CDN (Content Delivery Networks). If you have a million visitors a day (like Microsoft or Google) a CDN will be necessary, otherwise you can ignore that recommendation, but they do tank your grades for that.

So what did this do for me?

My site went from grades C and D (GTMetrix gives you 2 grades) to B and B, just by adding the caching. The GZip compression was requested in the Joomla Configuration (Server tab) on the site itself. No need to mess around with the .htaccess for that one.

If you want to check my site, you will see that for Compression I get an F. At first that sounds terrible. Until I looked at the individual recommendations.

"Losslessly compressing could save 22.0KiB (7% reduction)." Hardly worth fretting over.

So here you have the main culprits for slow sites. Bad image sizes, Caching and Compression.

Tinker around with these three and your site may have a quick boost in performance.

Good luck!

Henk von Pickartz

Written by : Henk von Pickartz

Hit the Help Desk