There are several ways to increase the performance and speed of the site:
Increased resources provided:
Website optimization is not in vain ranked first, because it has the highest priority among the rest.
If we take two completely identical servers with the same configured software and place them on the same site that uses an unoptimized theme, plus 2-3 dozen plugins that have not been tested by anyone in terms of load and interaction, and on the other the same site, but using caching of ready-made pages , with the critically necessary minimum of plugins / modules optimized among themselves, it turns out that the second server, even without performing other points, can work 2-4 times faster (in some cases everything is much more dramatic and the acceleration after competent optimization of the site is dozens of times) and create less load than the first.
In this article, there will be no specific recommendations for changing the script code to improve performance due to the complexity of implementing universal solutions for each control system. All actions for setting up and changing the site must be done independently or involve third-party specialists from the field of site development for this.
Of the simplest areas of optimization, the following stages can be distinguished, concerning almost all popular CMS:
Opt-out of plugins and additional modules
- all kinds of plugins, modules and extensions that seemingly expand the functionality of the site, in very many cases - its enemies in the context of performance. There are a lot of reasons for this. The main one - many modules are written by enthusiasts and are of very low quality both in terms of consumed resources and in terms of conflict-free with other modules and CMS
... Therefore, before adding a new module or plugin, think about whether it is possible to implement the same functionality without it? If not, after installation, test it in detail under load, see how resource consumption has increased, read reviews from other users.
Refusal from stolen and low-quality themes and plugins - oddly enough, this is also an important point, since in 8 cases out of 10 the hacked product, contrary to the assurances of hackers, remains not only dangerous in terms of possible "bugs" and backdoors, but also much more problematic in terms of resource consumption. "Self-written" components and themes in the overwhelming majority of cases are of very poor quality. Avoid them if possible. If low resource consumption is important, don't use “generic” themes. Due to the use of various additional frameworks, such "combines" work slower and consume more resources.
Caching pages with scripts - this method allows you to generate site pages in advance and save them to static files, which will be transferred many times faster. It is worth using the saving of pages by site scripts to files wherever possible. The return of a pre-formed page of the site spends much less resources and time than the formation of it for each new visitor "from scratch". This method is one of the most effective due to the use of static pages.
Optimization Database and requests To her
... When using the majority CMS
one of the most important points is the optimization of the database and queries to it, since it is used to store almost all the data required for the correct operation of the site and the generation of pages. Many sites can be slow only due to problems with storing data in the database and unoptimized queries to it. That is why TTFB can grow and the time for processing requests can increase.
Appeals to third-party sources... Loading data from other servers can be a huge problem in the speed of loading pages or generating them. There can be a huge mass of reasons for problems in loading resources, but the most frequent and resolved on the site side are:
Reducing the number of requests to the server... When loading a site, in the case of a lot of uploaded files, there may be problems in the speed of its loading or even in the form of errors. Hosting has certain restrictions on the number of simultaneous connections, and therefore errors may appear. But even if there are none, then a lot of requests will affect the site's loading speed. Each file creates a separate connection to the server, the process of initiating the connection and all other stages for the correct transfer of data also takes a certain amount of time, which creates delays in the site loading speed. If you compare two identical sites, but one contains 150 downloaded files, and the second contains the same data, but already in 50 files, then you can notice a significant increase in the speed of its display.
To solve this problem, we recommend:
Website resource optimization... When loading a site, problems may arise that the layout itself is loaded quite quickly, but the elements of the site are loaded for a very long time, everything freezes and so on. Most often, this problem occurs when large site resources are not loaded correctly. For example, images with a very high resolution are loaded for the mobile version at once in high resolution, or a lot of JS scripts with a huge amount of data are loaded. There are various technologies that can speed up the loading of data, for example, some of them:
AND another very effective
but a time consuming and not always possible way is to avoid scripting wherever possible. The fastest site is a site consisting of a set of static files. One of the options for such an implementation is the use of content management systems (CMS
) forming exactly the set HTML
-files (of course, the administrative part itself CMS
it may well consist of scripts). An example of such CMS
may be Movable Type
Within the framework of hosting, you can make certain settings that to some extent can help in optimizing the site's performance, but they should not be perceived as a universal tool for all occasions, since this or that technology may not bring the expected efficiency. Most of the recommendations for settings on hosting are geared towards using caching of data and pages for subsequent transfer to the client without re-processing the request by scripts and generating pages again. The principle of data caching allows you to reduce the amount of data transferred between scripts or servers, reduce the number of scripts processed, etc., thereby greatly speeding up the generation of a response. This method is quite useful for fixing the problem with high TTFB... It is important to consider that not for everyone CMS it is possible to customize all the specified optimization methods.
Enabling caching (Memcache(d))
... The use of Memcache (d) in different systems is organized in different ways, in some it is used exclusively for storing data transferred from databases (which allows you to save on the time of sending a request to the database, searching for the required data and sending the request back)
, in some it is used to cache specific pages of the site (which is more efficient in terms of speed, but less convenient in terms of generating dynamic content)
... It is worth noting that the behavior of caching data in memory Memcache (d) is specified directly in the site scripts.
Setting up caching Opcache
... Using Opcache saves you a lot of time by saving the compiled bytecode of your scripts. This method is extremely useful if you use a lot of unchanging scripts that can take most of the time. Unlike Memcache (d) – Opcache can be simply connected to the site without the need for additional configuration.
Using the data warehouse Redis
– in its own likeness, this method is similar to using Memcahce (d) due to the fact that they both save data to RAM and then allow it to be used for faster access, the logic of the behavior of saving data and other things is also similar.
Using optimization opportunities PageSpeed
... The PageSpeed optimization module is installed on the hosting by default and all its capabilities are available for any site. To some extent, most of its settings can be dangerous for the operation of the site due to the fact that the names of the loaded scripts, the principle of their loading, etc., are changed, depending on the included parameters, but as one of the optimization methods – it can be considered to speed up the loading of content. It is important to understand that in order to reduce TTFB
(response time from the server) this method will not work at all, since it is aimed at improving the generation of pages in the client's browser and loading the site's resources.
Caching static content
... An extremely useful fundamental feature for speeding up the loading of web pages is the caching of the pages themselves and the resources connected to them. It is important to pay attention to the fact that such caching is performed not on the server side, but on the client side, and therefore the first loading of the site will be unchanged, but subsequent page transitions or entries to the site can be much faster and not noticeable at all, with the correct organization of the site and caching.
How can I speed up my website?
Website optimization is carried out exclusively by specialists from the field of website development. Hosting does not have the ability to perform such optimization and provide specific recommendations for each situation.
Is it possible to speed up the work of the site by changing the tariff?
Shared hosting tariff plans work on the same servers, so changing the tariff is unlikely to help.
If tariff plans are used businesshosting, then it is worth looking at the current load curves to the server - if they observe the limit indicators of resource consumption, then change of tariff plan higher may help in solving the problem.