How to accelerate your website? It is awful to realize
that success of the website which pages you filled with various information was decorated with a set of pictures, recovered by means of java - scripts, it can be under the threat from - for slow its loadings in the browser.
But what to do if the web - pages is simply necessary for you each element of yours, each picture and each java - a script is expensive. Here about it, namely I suggest to talk about ways of acceleration, optimization of the website today.
In my last article on this subject we defined that duration of loading of pages of your website in the browser is defined by amount of inquiries which it forms, and duration of execution of these inquiries. Let`s not go deep into this subject again, and we will pass directly to councils for acceleration of your website. These councils especially will suit owners of the portals created on the basis of CMS as problems of fast loading of pages most often meet just on the similar websites. So, we will start:
1 council. Optimization of stylesheetsare very convenient to
of the Stylesheet in application and have to be used on one and all portals. Often happens, especially when using CMS that such stylesheets appear a little, and, therefore, the browser sends inquiry for everyone on what more time is spent.
In this regard first council: unite all existing stylesheets in one file. Besides, this received file it is possible and it is necessary to optimize. Delete unnecessary lines, gaps, reduce information on flowers - for example, replacing white color in writing “#ffffff;“ on shorter “#fff;“ what in the end result will affect the size of the received file and will accelerate process of its loading. It is the best of all to connect stylesheets in a page code in the field of the HEAD tags, that is in the top part of the page.
2nd council. Optimization of java - scripts
When using java - scripts often should connect the relevant libraries for their correct work. Often these libraries are loaded directly from files of the website whereas it is possible to load them in more squeezed view from the specialized websites on the Internet, for example, from Google services.
Besides, codes of scripts, however, as well as lines of connection of their libraries, unlike stylesheets, should be placed in the end of pages of your website. It is connected with the fact that the browser, meeting java - a code on the way, stops loading of the page until processes this code completely. Besides, as well as in a case with stylesheets, files also should be united with scripts. Here you will be come to the rescue by special services which will expedite merge and is qualitative.
3rd council. Use sprayta css
Besides pictures which are loaded on your website dynamically, for example, in course of execution of PHP - a code, there is also a set of pictures which appear in css the file of your website. For each of them the separate inquiry is also formed.
But in case of application of the css technology - sprayt all set of requests for pictures can be replaced unique. The essence of a method consists that only one picture on which in certain positions with in advance known coordinates are located a little, usually to 20 which were loaded one by one earlier is created.
And now instead of lines with connection of each of pictures you every time write the same line with a call of one of the general, created by us, and by means of the indication of certain spaces, and in other words, coordinates, specify location of that concrete picture which is necessary for you. Thus we manage to reduce number of requests of the browser with 20 to 1!
4th council. Use technology of a caching of pages of your website
If your resource does not mean continuous change of content, you need to use technology of a caching of pages. In this case at the repeated addressing of the user pages of your website the browser does not need to send every time requests for the server any more, and it is only enough to apply for information in a cache that considerably will reduce the speed of loading of your pages.
Here, perhaps, the main methods of optimization of a resource for the purpose of its acceleration. Besides listed, there is a set of other ways, but about them if it is interesting, we will talk next time.
And let pages of your website are loaded at lightning speed!