Foundations

11 ways to optimise your website

13 Dec 2021
blog post.png

Image generated by AI. Source: Midjourney

"Know that something is going on." Using a medieval reference - it's like you sent a knight in beautiful shining armour to a battle but forgot to arm him with a sword, a shield, an axe, or a helmet. On the battlefield, he would be doomed.

Every website has to undergo constant optimisation to remain attractive to its users. There are many popular tricks to do this, but I will focus on those less known. For a moment, forget about optimising images or reducing JS or CSS code. In this article, I will share some commonly omitted tricks to improve website speed, UX, SEO, and efficiency.

1. Instal mod-pagespeed

Mod_pagespeed takes over some of the work related to optimising your website. What does this mean in practice? Nothing other than that, it carries out automated analysis of the site. Aside from the analysis, the module implements modifications that significantly influence a website's performance. As a result, page speed compresses images, decreases the number of JavaScript files, and limits the number of HTTP queries. It is worthwhile to check how your site behaves after implementing the mod. As a result of the conversions carried out by it, the JavaScript code changes. In such a case, you should enable a proper filter or implement appropriate modifications to solve the problem. It's possible to disable every filter which modifies the code.

Sometimes it may be impossible to install the module. Use PageSpeed Insights, put it in your domain, and check what areas should be optimised. The best thing to do is to implement all modifications suggested by the test.

2. Use Open Graph

Open Graph tags are a solution to increase the exposure of your service on social media. If you use Open Graph tags, the links to your site shared on Facebook are much more attractive and gain more advertising value. You should also test how your content is presented on Facebook. Most of all, the graphical elements should be of the proper size. The minimum image size which will show well on FB is 1200 x 630px. Read up about the good practices for passing images to Facebook. One curious fact is that Facebook will not generate a thumbnail image the first time the URL is shared. It will show it the second time it is shared. Another curiosity is that if you use the wrong image or want to change the content of the description – you don't have to wait a day to make those changes visible. All you have to do is refresh the page using a particular tool.

Suppose you're running a store based on an open-source engine (Prestashop, Magento) or a web service based on WordPress. In that case, you should look for free plugins that automatically implement Open Graph.

web development, coding 1.png

Image generated by AI. Source: Midjourney

3. Help the search engines - use microformats

Bordering on a certainty that many web services don't use this form of optimisation. My gut tells me this results from a lack of knowledge and that we still leave how our site appears in search results to "chance." It means that Google only displays the information included within the title, link, and meta description attributes, while there's much more to be achieved in this field. Google allows for displaying contact details, a search engine, point-based reviews, the number of reviews, prices, etc. If you do, the links leading to your site will be much more attractive, and as a result, the traffic on your site will increase.

Depending on the market sector in which you operate, you can adapt the elements that suit your business activity profile. If you want your logo, direct contact details or links to social media to appear in the search engine, add the proper code to your site. If running an online store, enrich your search results with prices, reviews, stars, and availability information. Breadcrumbs can also appear directly in Google. Keep in mind that each newly implemented feature should be tested. It's the same with microformats. You don't have to wait for Google bot to index the new information. You can try everything using the right tools.

4. Provide Googlebot with paginated content

If your site uses pagination for links "previous/next," it is crucial that you also provide this information to Google. For this purpose, you can use the rel=" prev" and rel=" next" attributes. So Google can use the "hidden" content when it uses the pagination mechanism because we indicate the logical relation between pages. You can also consider adding elements within the head section of your site to indicate the URL of the next and previous page.

5. Avoid content duplication at all costs

The legendary duplicate content, internet is filled with content about this phenomenon. One thing is sure; it's better to avoid it and eliminate any content duplication on your site. It is not very attractive to the user, nor is it to Google. One of the many things related to duplicate content is website redirection. Promoting the idea of "killing" the WWW in web addresses makes sense. Physically, it's just an additional subdomain that does nothing other than generate unnecessary DNS traffic. Eventually, your site will have two separate addresses (e.g., www.yourdomain.com and yourdomain.com), which include the same content. This kind of optimisation is an SEO optimisation that will positively impact your position within the results of a search engine.

web development, coding 2.png

Image generated by AI. Source: Midjourney

6. Show Google that your web service is multilingual

The rel=alternate and hreflang=x attributes help display your site correctly within the search results for global and regional searches. A good tip: if you want your site to the index for regions adequate for a particular language, a good practice is to publish different language versions using separate subdomains, e.g., es.domain.com, or domains, e.g., domain.es.

7. Improve performance by placing temporary files in RAM

Do you have a dedicated service and use a Linux operating system? In this case, you can improve the performance of your service by placing temporary files in RAM. They can be accessed and stored much more quickly this way. For this to work, you must create a tmpfs (temporary file storage facility) partition and direct all file storage toward it. The files that migrate a lot don't take up much space, and if you lose them, it doesn't cause catastrophic results. Performance can be improved by as much as 30% if you use this method for temporary files on a MySQL server. It also makes sense to use it for PHP session files.

8. Install Memcached and further improve performance

The performance of a web service should be improved in any field possible. It may sound like a cliché, but it is a mistake to ignore this recommendation when we use a hard drive to store temporary files (cache). This is simply ineffective. In this case, it makes much more sense to use Memcached or some similar system. It would help if you commissioned a software developer to do this for you. Once done, the temporary files will be stored in RAM, making it much quicker. This type of optimisation particularly impacts the improvement of performance.

9. Make your server stop asking DNS servers for the hostname

Set Apache > HostnameLookups to Off. This will make your server stop asking DNS servers for the hostname. This information is useless. Look at the format of Apache logs. You should find a %h variable that forces obtaining the hostname for storing it in log files. Consider if it is necessary. Perhaps you can change it to %, which will return the server's IP much more quicker.

web development, coding 4.png

Image generated by AI. Source: Midjourney

10. Create an attractive favicon

How many of us designed a favicon which looked like Logo Comenius? Favicon.ico is slowly going away. Today, favicon must adapt to every medium automatically. You can use http://www.favicomatic.com/ for that. All you have to do is put in a logo with 1024 x 1024. You will get all the necessary sizes so that the favicon appears in the best possible quality, optimised for the smartphone, tablet, or laptop. Just use the code you get in the head section of your site, and it's done. Icons will be used in favourite lists, home screens, and desktops of all devices right in the places where they are pinned.

11. Show your good side

Do you want the browser to change colours to those which you have used on your website? All you have to do is add a tag in the head section of your site – . Just keep in mind to use your colour in the code. By implementing this tag, you improve the visual attractiveness of your service.

Optimise for the win!

Although optimising websites is not the most fascinating job in the world, when running a web service or internet application, you should treat this area as necessary. You optimise – you win. Simple as that.

Grzegorz Kiersznowski.jpeg

About the Author:
Grzegorz Kiersznowski - CTO @ Autentika.

Share Article:
Let's talk
If you feel we are a good fit, email us today, or call Slawek +48 603 440 039You can also follow us on Linkedin, Facebook or Dribbble.