viewport
. It indicates how the page should scale to the resolution of the mobile device.robots.txt
file. And it prohibits the indexing of addresses starting with /bitrix
./bitrix
in robots.txt
., . , , JavaScript .
JavaScript
, «1-» Page Speed Insights . JavaScript . , « JavaScript ». ?
, JS-
, . , , JavaScript .
JavaScript
, «1-» Page Speed Insights . JavaScript . , « JavaScript ». ?
, JS-
, . , , JavaScript .
JavaScript
, «1-» Page Speed Insights . JavaScript . , « JavaScript ». ?
, JS-
, . , , JavaScript .
JavaScript
, «1-» Page Speed Insights . JavaScript . , « JavaScript ». ?
, JS-
, . , , JavaScript .
JavaScript
, «1-» Page Speed Insights . JavaScript . , « JavaScript ». ?
, JS-
. And the order of the moved code is fully preserved. According to our statistics, after such a transfer, 95% of the pages remain operable.data-skip-moving=true
, which prevents tag transfer. It can be specified for both internal scripts and external scripts.document.write
construction, which browser developers do not recommend using. It displays arbitrary HTML in the place where it was called. Naturally, if we bring the JS down, then this HTML will also be displayed below, and not where required.\Bitrix\Main\Page\Asset::getInstance()->setJsToBody(true); //
\Bitrix\Main\Page\Asset::getInstance()->setJsToBody(false); //
JavaScript exception
. Although the user will not see this error, the element simply does not respond to its actions. And if the user clicks on the item again after loading the script, then everything will work.addEventListener
method is more addEventListener
. Rewrite the previous example on jQuery.DomContentLoaded
. And this event occurs only after you have all the JS loaded on the page and executed. That is, until the most recent script runs, this event will not occur. Therefore, even though we got rid of onclick in HTML, there are still problems with usability: when the user clicks on an element whose script has not loaded yet, nothing happens. What can be done here?DomContentLoaded
DOM before the DomContentLoaded
event DomContentLoaded
. Naturally, with some kind of fallback: if there is an element, then hang the handler, if not, then call it on DomContentLoaded
.. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
. , CSS. , CSS, ? , « », TCP. , - , . - , , , .

Initial Congestion Window
( ). Linux, , 10. roundtrip 10 . Linux ICW 4. 1,46 , , , 14,6 . , , , gzip. , Google . Page Speed roundtrip .
CSS ? :
, . . . , . bootstrap, . Audits Chrome Dev Tools, . , . , , . JS. Google, . Initial Congestion Window
. , «24» 20, roundtrip CSS JS.
«1-» « ». ? c CSS- JS- , min, . , . , , .
Page Speed Insights : , . 1000 , 200- . Page Speed Insights 30 . , . , . , Google Page Speed — .
: CDN « ». CDN , CSS- JS- . « », , — .
:
gzip-, « » - . , «1-» . HTTP-. , gzip HTTP- . . . Google, 200 HTTP- .
.
Mobile-Friendly Test, -, :
, m..ru, HTML User-Agent.
Google . , , . -, robots.txt
.
Page Speed Insights . , , , .
«1-», « ».
Source: https://habr.com/ru/post/263433/
All Articles