Here are a few things you can do to increase the performance of your website.
Don’t Skimp on Hosting
Hosting is just like everything else in life, you get what you pay for. Sure, you might be able to find shared hosting for really cheap. But, your website performance is going to reflect that.
The job of your host is to respond to requests it receives from a visitor’s browser. This often includes sending images, html, and other assets over the internet so that the browser can assemble a web page. Your host will also respond to user input, like a form submission for example.
On a shared host, the resources are split with all the other websites on that host. Basically, if one of the sites on your shared server is using a lot of resources, there will be less for your site to use. This can translate into slow load times and server errors. If your site takes a long time to load, visitors are not going to wait for it. If there is an error when they submit a form, they probably aren’t going to try again.
Decent hosting is not that expensive. It might cost you an extra $50 a year. But the increase in your site performance will be invaluable.
Always Optimize Images
Images usually make up the bulk of your website’s size. If you have too many or they are too big, they can really drag down the load time of your site. This is especially apparent if someone is visiting your site on a slow connection. Like if you are at a conference where everyone is using the same WiFi.
If your image file is 300mb and your connection is only 30mb/s it’s going to take 10 seconds for that image to load. No one is going to wait that long.
An important thing to note is that, optimizing images does not make them lose quality. What most people don’t realize is that image files include a lot of metadata that has nothing to do with how the image appears. Some images can have their file size reduced by 50% or more simply by removing this metadata.
Image optimization can be done in programs like Photoshop. It can also be done programmatically on your server so that any time you upload a new image, it is automatically optimized.
Caching is basically temporary storage. When it comes to your website, there are a number of different layers where caching can be implemented. Your browser will often cache assets so that when the page reloads it doesn’t have to request them again.
You can also implement caching on the server. Most websites are running on a content management system. When a browser makes a request, the server has to run a script that will create an html document that it sends back to the browser. This html can be stored on the server and served up to the user rather than having the server recompile everything.
Use a Content Delivery Network
When your browser makes a request for something, that request has to travel through your internet cable all the way to the server that can fulfill that request and then all the way back. The time that this journey takes is commonly referred to as network latency.
There are a number of factors that contribute to the length of this journey. A high speed fiber optic connection is going to be much faster than using 3G on your phone. Distance is also a factor. If you are in New York and you are requesting a webpage that is hosted in China that trip will take longer than if you were requesting a webpage that is hosted in Jersey.
A Content Delivery Network (CDN) is a method for reducing this latency. Basically, your website resources are copied to distributed locations around the world. Then when a browser makes a request it’s directed to the nearest location rather than having to travel half-way around the globe.