Lessons
-
Introduction
-
Search engine optimization
- Broken links
- Site map
- Micro-markup
- Robots.txt
- References
- Text
- Duplicates
- Basic
- Pictures
-
Speed
-
Minification
-
CSS minification
Minification of JavaScript files
Minification of inline CSS code
Minification of images without loss of quality
Minification of JavaScript files
Unused CSS code
Data optimization:Image URLs
Format of animated images
Unused JavaScript code
Using WebP
Image compression is missing
Video bitrate
-
Reducing requests
-
An overabundance of small pictures
Ungrouped CSS files
Ungrouped JavaScript files
An overabundance of fonts
Availability of end-to-end CSS, JS files
The presence of a monochrome font
Uploading duplicate files
Using JS facades
Redirecting JavaScript code
Adding lazy loading
Redirect from/to www version
- Fonts
- Loading time
- Server Settings
- Pictures
- The first content
-
Minification
- Mobility
- Bugs
-
Convenience
- Social networks
- Web Application Manifest
- Favicons
- Basic
- Text readability
-
Security
- Encrypted connection
- Exploits
- Vulnerabilities
Total loading time
The page files are loaded in the following order:
- Download HTML code.
- Loading the resources specified in the code. These are images, CSS, JavaScript code, and other files.
- The second stage of resource loading. For example, if the CSS code specifies an image as the background, it will load at this stage. JavaScript code is executed in synchronous, single-threaded mode. He can download other files, but this is considered bad form, as it leads to problems of multithreaded programming.
- The onpageready event is triggered. At this point, the browser stops showing the icon that the page is loading. This is considered a page load. When this event is triggered, the browser ensures that the HTML code of the page and all files of the first two stages of loading are fully loaded, and the JavaScript code is executed.
- Loading deferred resources. The onpageready event can have many handlers. Some of them run business logic like generating interactive functions. Some handlers can send data and upload files. But if your site is not some kind of complex online software product, then all business logic is processed in a split second, and network requests are made asynchronously. Therefore, it is considered that the page is ready to work and interactive at this moment.
The main way to speed up the site is to transfer everything you can from the first three stages of loading to the last:
- Upload captcha code, maps, online consultant and other third-party services not by placing the
<script>tag in the HTML code of the page, but by adding an onpageready event handler. - It is also better to load large chunks of content delayed. For example, the product profile may contain recommendations for similar products. Since the user scrolls through the page and sees the recommendations in 10 seconds at the earliest, it makes sense to load this data with a separate request. You can also do this in the onpageready event handler code.
- Media files, such as video and audio images, are best downloaded on demand. Pictures when the user scrolls the screen and is 1-2 screens away from them. Video and audio when the user presses the play button.
If the page takes 30 seconds or more to load, it means that there are files blocking the final download. One or more files cannot be downloaded and the browser waits 30 seconds before it refuses to download them and puts the page status in the “ready” state.
Any comments or additions? Send us an email admin@site-alarm.com .
Check your website