Lessons
-
Introduction
-
SEO
- Broken links
- Site map
- Semantic markup
- Robots.txt
- References
- Text
- Duplicates
- Basic
- Pictures
-
Speed
-
Minification
-
Minification of CSS to reduce its volume
Minification of the embedded JavaScript code of the page
Minification of the embedded CSS code of the page
Minification of images without loss of quality
Minification of JavaScript files to reduce its volume
Unused CSS code
Data optimization:Image URLs
Animated image format MP4, WEBM, SVG instead of GIF and WEBP
Unused JavaScript code
Using the WebP format in images
Too high-quality images without using compression
Suitable video bitrate
-
Reducing requests
-
An overabundance of small pictures
Grouping CSS files
Grouping JavaScript files
An overabundance of font files
Availability of end-to-end CSS, JS files
The presence of a monochrome font
Uploading duplicate files
Using JavaScript 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
Setting up a pre-connection
Removing lazy loading
Long JavaScript code execution time
File upload delayed or on demand
The server is located in the same country where the users of the site live
No requests to another country that cause page loading to be blocked
-
Minification
-
Mobility
-
Screen support
-
Adapting the layout to a Full HD computer monitor
Adapting the layout for a horizontal tablet
Adapting the layout for a horizontal phone
Screenshots for the mini-report
How blocks break the page layout
Adapting the layout to an HD computer monitor
Adapting the layout for a vertical tablet
Adapting the layout for a vertical phone
- Comfort
-
Screen support
- Bugs
-
Convenience
- Social networks
- Web Application Manifest
- Favicons
- Basic
- Text readability
-
Vulnerabilities
- Encrypted connection
- Exploits
- Vulnerabilities
File upload delayed or on demand
First of all, you need to download the content that is located on the first screen. This way the user will start exploring the site faster, which will increase the conversion rate. The download of all other content needs to be postponed. To do this, call the loading of heavy scripts and services in the window.onload event or at the time of their demand.
Delayed loading of analytics tags
Although companies that supply analytics systems recommend downloading their code as early as possible, they do not provide technical explanations why this should be done. Therefore, it is possible and necessary to load the counters postponed.
You can postpone the Yandex Metrica download like this:
window.addEventListener("load", function() {
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(123123123, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
});
Google Analytics like this:
window.addEventListener("load", function() {
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://www.googletagmanager.com/gtag/js?id=G-123123123", "ga");
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-123123123');
});
In addition to the Yandex metric and Google Analytics in the event window.onload need to load all advertising and referral counters.
Cartographic services, online consultants, third-party authorization systems (VK ID, Yandex ID, etc.)
If the map is located on the first screen, then it needs to be loaded immediately, if below, then in the window.onload event.
It is done this way:
window.addEventListener("load", (event) => {
setTimeout(function() {
// Here is a call to the loading code
}, 50);
});
``
or jQuery version
```language-javascript
$(window).on("load", function(event) {
setTimeout(function() {
// Here is a call to the loading code
}, 50);
})
Captchas
The captcha script must be initiated when the form fields are filled in. That is, by the focus event on any of the form fields.
Here is the jQuery code that initiates the Yandex captcha for the form when the user starts filling it out:
“language-javascript /A function that connects a captcha to a form/ function initSmCaptcha(form) { // Check if a captcha was initiated earlier if(form.is(‘[sm-captcha-applied]’)) return; // Adding captcha initiation at the focus event form.find(‘[type=text], [type=tel], [type=email]’).focus(function() { form.attr(‘sm-captcha-applied’, ”); // Adding a block unique to the form for displaying captchas var containerId = ‘captcha-container-‘+(new Date).getTime(); form.append(‘
’); var renderCaptcha = function() { window.smartCaptcha.render(containerId, { sitekey: ‘SMARTCAPTCHA_CLIENT_KEY’, invisible: true }); }; if (!window.smartCaptcha) // Loading the captcha code $.getScript(‘https://captcha-api.yandex.ru/captcha.js’, renderCaptcha); else renderCaptcha(); }); } “`