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
-
The sequence of connecting JavaScript files
Font display mode
Preliminary connection
Removing lazy loading
Long JavaScript
Premature file upload
Matching language and hosting
Blocking requests to another country
-
Minification
- Mobility
- Bugs
-
Convenience
- Social networks
- Web Application Manifest
- Favicons
- Basic
- Text readability
-
Security
- Encrypted connection
- Exploits
- Vulnerabilities
Blocking requests to another country
The further away the servers are from the user, the more time it will take for the light to travel the distance back and forth. This delay is called ping and depends on the distance, the number of hops (the number of routers between the user and the site), as well as the route of network packets.
Blocking files are files that the page won’t issue the loaded event without loading. And this is a key event in the stages of page loading. Without it triggering, the page will simply freeze. That is, if the blocking file cannot load, then the browser will wait up to 30 seconds, waiting for it to load.
If you use foreign services such as counters, card APIs, authorization systems, payment systems, CDN services, captchas, etc., then make sure that the connection of these scripts is non-blocking. Otherwise, all, part or individual users will get a broken page due to network problems or the availability of foreign services.
Enable the JavaScript function in the ready event.
An example in jQuery:
$(document).ready(function () {
var script = document.createElement("script"); //
script.src = "https://example.com/script.js"; // path to your file
document.head.appendChild(script);
});
Example in native JavaScript: “javascript window.addEventListener(‘load’, function() { var script = document.createElement(“script”); // script.src = “https://example.com/script.js”; // path to your file document.head.appendChild(script); }); “`