I decided to give you some tips how you can speed up your site. Go through them in the order as they are listed and continue until you think your page is fast enough. The first tips will require no changes on your page so they are the ideal. Then later I get to points which already require making some changes in terms of homepage layout etc.
- Make sure you are running the latest version of Meteotemplate – this is obviously very important because every version includes new and new optimizations
- Check if your provider offers PHP 7+ – this can make a huge difference. Meteotemplate works perfectly fine even with the latest PHP 7.1. PHP 7 underwent a huge optimization and is much faster so just upgrading your PHP version is likely to have a significant impact on loading speed.
- Check the number of blocks on your homepage – remember that the more blocks you have, the longer it will take to load the page. Also keep in mind that sometimes (and in this case it is true), less is more. You obviously want to provide your visitors information, on the other hand you should also aim for ease of use and being able to clearly and easily find what I need. It is likely that too much stuff will be confusing or discouraging for your visitors.
- Make use of “menu blocks” – only the first block in menu blocks is loaded, other ones are only loaded when the visitor requests it, speeding up your page and making the homepage shorter and more organized.
- Double check your update intervals – if your webpage seems slow even after you have tried the above, check what the update interval is and think about whether you really need it to be that short. You should never have it longer than 5 minutes, but if for example you are using 30s, try increasing it to 60s. This will only have an effect on your current conditions blocks. Also take into account the interval at which your station reports. If your station only reports every 48s (my case), then using 30s update interval is a waste of resources and bandwidth.
- Check cache times – some blocks and plugins allow you to set the cache times so you might want to check these as well and think about whether they have to be this short.
- If you tried all the options above, but your page still seems slow to you, then visit some Meteotemplate page of other users, just to make sure the problem is in the server and not your internet connection. Ideally check the DEMO on my site. My server is not the slowest but also not the fastest so it should give you a rough idea as to how an average page should load. If you find even the DEMO loading very slowly, then the problem is likely to be in your internet connection, in which case you don´t have to worry much because it loads faster for others. If you find that DEMO loads very fast, but yours slow despite you trying all the tips above, then the only other option would be thinking about changing your server.
Last but not least, please bear in mind that Meteotemplate will never be as fast as some of the other templates like Saratoga or Leuven. This is simply due to the underlying principles of how they work. Meteotemplate, unlike all the other ones, uses a database, it therefore processes all data in real-time and performs tasks which for the other templates are done by the actual software you use. Database will always slow things down, but on the other hand, it obviously also gives you an absolute freedom as to what you can calculate – something that you will not find in the templates which only work with the data sent by whichever software you use.