A content management system (CMS) driven website solves a lot of problems presented in modern day websites; namely the ability for people without web development skills to edit their website. The ability to keep a website up-to-date is important for a number of reasons, none moreso than to retain your visitors.
As with most solutions, a CMS presents further problems; most commonly, performance issues. Here’s a few ways to mitigate these issues and ensure your website loads quickly. There are a lot of guides on how to specifically speed up certain CMS platforms but I’ve taken a step back and provided solutions for general CMS optimisation problems.
1. Page caching
If you are running a site that serves thousands of visitors then these database queries, however much you have optimised them in step 1, are going to be intensive. It’s going to be a hit on your bandwidth (which could increase costs) and also slows down your site.
Solution. Page caching. When a page is first retrieved it is stored (cached) as a static page (e.g. HTML) and then further visitors will be served that static page. No database calls means the site is back on par with the speed of static sites. If you edit the content of the page in the CMS then the cache will be cleared so visitors still receive a up-to-date version of the site and not a cached one.
2. Clever coding
If you analyse a CMS template/theme you will see that there can be up to 20 database calls on a page. Whether this be the title of the page, the date an article was posted or the location of a stylesheet. The reasons why they are dynamic in the first place is to provide flexibility, often provided through options pages.
Solution. Have a look through your website. Are there any settings that are never going to change? If so you can hardcode these into your themes so they do not require an extra database hit, which in turn will load the pages quicker. Do you need the footer text to be driven by a text field on the options page? Probably not.
3. Using a Content Delivery Network (CDN)
Using a CDN such as Amazon Cloudfront is undeniably a way to speed any website up. When a request for a file (such as an image) is requested it is served by the CDN from the Amazon storage system (Amazon S3). Not only do you have the benefit of having your image stored on a more powerful server (Amazon S3) but whilst you are being served the image you can also be served the rest of the site simultaneous. It’s not only file sizes that are the problem but the amount of requests made on a server.
4. Optimise the database
Installing plugins not clearing up afterwards can cause problems. The larger the database the more the longer the search queries.
Optimise your database by clearing out tables and data that are not needed. If you’re searching through 10,000 entries, rather than 20,000 this will speed things up considerably.
5. Broken links
Analyse your code and get to know it. Make sure that if the page has tried to load an image and if it hasn’t investigate as to why. Using Pingdom Tool you can check how long it’s taking to load a file and it ‘greys out’ the ones that it can’t find. Those are the ones that need your attention.