Even with a user-friendly navigation, nice design and high informative site may use less popular than the resource-rival, losing much of these criteria. A reason for this may be a long loading pages. Users simply tired of waiting until the desired page progruz them, and leave the resource. Perfect page loading speed of 2 to 5 seconds. Visitors to the site will suffer and 10 seconds boot, but only if there is not a lot of downloads. Do not forget that the download speed is a criterion for ranking in search engines. Page load time can be reduced by optimizing its components.
The large size of the files is uploaded to the page adversely affect download speed. Therefore, images that are used on the site, it is necessary to compress with special programs that use compression algorithms that are optimized for the WEB. On page load time also affects the number of loadable files. Merge multiple files into one CSS style file will increase the page load time. But combining several images into one big, you risk the contrary lower download speed. Do not forget that beautiful JS effects podgruzki require special libraries, which have sometimes impressive size. Connecting the CSS files in the tag head html document will allow content page loaded with all styles gradually, from top to bottom. This will serve as a kind of indicator for the user and allow him to start using the site, while it is completely downloaded. Connecting JS libraries to the end of the file will allow the visitor to see the page before it is fully downloaded. HTTP / 1.1 specification allows you to download at the same time no more than two components of the site at the same time from a single server. Placing individual files on subdomains, you can significantly increase the download speed. For example, your site is available at site.ru, and pictures for him will be available at image.site.ru. Browser it will be different server, but all can be stored on a single host. To download popular JS libraries can be used CDN (Content Delivery Network). This is a series of servers, with reference to which is chosen server with the highest upload speed for this resource. In this method has another advantage - if the user's browser cache already has the required library, it will be used from the cache.
Modern websites generate the final document html code of the script, and the contents of the database. Scripts are even on the fastest servers can not produce results immediately. If we consider that most of the operations carried out with the same parameters, the use of the cache significantly reduce loading time of the site. When using large libraries JS and CSS files, you can use the browser cache, of course, if it is available. To this must be available module Expires server Apache, and in the .htaccess file should be relevant Directives:
Header append Cache-Control "public" FileETag MTime Size ExpiresActive On ExpiresDefault "access plus 0 minutes" ExpiresByType image/ico "access plus 1 years" ExpiresByType text/css "access plus 1 years"
In this example, the favicon and css files are written in the browser cache and will be stored for a year. That is, if the user goes to the site a week later, he will not have to download the CSS. But this method also has its drawbacks. If you made changes to the styles of the site and the user boot file from the cache, then it simply will not see them. The solution to this problem may be a renaming of cached files. As a rule, the file name appends version and change the file change it.