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
The total size of all images on the page
The large total size of the images indicates several possible problems:
- Delayed loading technology is not used. You need to download only those images that are visible on the first screen. You need to upload the rest of the images at the time of request, when the user scrolls the page and they become visible.
- Missing minification. The opportunity to reduce the size of images without loss of quality using modern algorithms has not been used.
- You are using excessively large images. If the source file has a size of 1000 pixels, and it is displayed in a block of 150 pixels, then you should reduce the size of the source file.
In the example below, you can compare how adding the loading=”lazy” attribute affects the loading speed.
Demonstration
PHP code
HTML code
<?php
if(isset($_GET['t'])) {
// Симулируем задержку загрузки изображения, как для интернета 4G.
usleep(100000);
header('Content-Type: image/jpeg');
echo file_get_contents('photo.jpg');
die;
}
$mode = $_GET['mode'] ?? '';
?><!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.product-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
font-size: 20px
}
.product-grid img {
width: 100%;
}
.product-grid .product {
position: relative;
}
.product-grid .time {
position: absolute;
left: 5px;
top: 5px;
background-color: #fff;
padding: 1px 4px;
}
.btn {
color: #000;
text-decoration: none;
padding: 5px 10px;
border: 1px solid #000;
border-radius: 5px;
}
.btn:hover {
background-color: #ddd;
}
.btn.active {
background-color: #000;
color: #fff;
}
</style>
<script>
// Функция, которая добавляет на изображение время окончания загрузки
function endLoading(el) {
var time = performance.now()/1000;
el.parentNode.insertAdjacentHTML("beforeend", '<div class="time">'+time+' с</div>');
}
window.addEventListener("load", (event) => {
document.querySelector('#page-load').innerHTML = 'Страница загрузилась (событие window.onload) за <b>'+(performance.now()/1000)+'с</b>.';
});
</script>
</head>
<body style="font-family: sans-serif;">
Режим: <a class="btn <?=$mode === '' ? 'active' : ''?>" href="./images_total_weight.php">Обычный режим</a> <a class="btn <?=$mode === 'lazy' ? 'active' : ''?>" href="./images_total_weight.php?mode=lazy">Режим отложенной загрузки</a>
<p>На странице 5.41 МБ изображений. При отложенной событие window.load отрабатывает сразу.</p>
<p id="page-load">Тут отобразится время загрузки страницы (вызова события window.onload)</p>
<div class="product-grid">
<?php for($i = 0; $i < 100;++$i) { ?>
<div class="product">
<img src="./images_total_weight.php?t=<?=microtime(true)+$i?>" <?=isset($_GET['mode']) && $_GET['mode'] === 'lazy' ? 'loading="lazy"' : ''?> onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<?php } ?>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.product-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
font-size: 20px
}
.product-grid img {
width: 100%;
}
.product-grid .product {
position: relative;
}
.product-grid .time {
position: absolute;
left: 5px;
top: 5px;
background-color: #fff;
padding: 1px 4px;
}
.btn {
color: #000;
text-decoration: none;
padding: 5px 10px;
border: 1px solid #000;
border-radius: 5px;
}
.btn:hover {
background-color: #ddd;
}
.btn.active {
background-color: #000;
color: #fff;
}
</style>
<script>
// Функция, которая добавляет на изображение время окончания загрузки
function endLoading(el) {
var time = performance.now()/1000;
el.parentNode.insertAdjacentHTML("beforeend", '<div class="time">'+time+' с</div>');
}
window.addEventListener("load", (event) => {
document.querySelector('#page-load').innerHTML = 'Страница загрузилась (событие window.onload) за <b>'+(performance.now()/1000)+'с</b>.';
});
</script>
</head>
<body style="font-family: sans-serif;">
Режим: <a class="btn active" href="./images_total_weight.php">Обычный режим</a> <a class="btn " href="./images_total_weight.php?mode=lazy">Режим отложенной загрузки</a>
<p>На странице 5.41 МБ изображений. При отложенной событие window.load отрабатывает сразу.</p>
<p id="page-load">Тут отобразится время загрузки страницы (вызова события window.onload)</p>
<div class="product-grid">
<div class="product">
<img src="./images_total_weight.php?t=1770055045.1417" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055046.1417" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055047.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055048.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055049.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055050.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055051.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055052.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055053.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055054.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055055.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055056.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055057.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055058.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055059.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055060.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055061.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055062.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055063.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055064.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055065.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055066.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055067.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055068.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055069.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055070.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055071.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055072.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055073.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055074.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055075.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055076.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055077.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055078.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055079.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055080.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055081.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055082.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055083.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055084.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055085.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055086.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055087.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055088.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055089.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055090.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055091.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055092.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055093.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055094.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055095.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055096.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055097.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055098.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055099.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055100.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055101.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055102.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055103.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055104.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055105.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055106.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055107.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055108.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055109.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055110.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055111.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055112.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055113.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055114.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055115.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055116.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055117.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055118.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055119.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055120.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055121.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055122.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055123.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055124.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055125.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055126.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055127.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055128.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055129.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055130.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055131.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055132.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055133.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055134.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055135.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055136.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055137.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055138.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055139.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055140.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055141.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055142.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055143.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
<div class="product">
<img src="./images_total_weight.php?t=1770055144.1418" onload="endLoading(this)" /><br />
Товар 1<br />
1000 руб.
</div>
</div>
</body>
</html>