ãã®èšäºã§ã¯ãã¬ã€ã¢ãŠãã·ããããšãCLSãã«ã€ããŠã
- ã¬ã€ã¢ãŠãã·ãããšã¯
- CLSãšã¯
- ãã¬ã€ã¢ãŠãã·ããçºçç®æããããããããŒããŒã«ã§ç¢ºèªããæ¹æ³
- ãCLSããããããããŒããŒã«ã§ç¢ºèªããæ¹æ³
ãªã©ãå³ãçšããŠåããããã説æããããã«å¿æããŠããŸãããåèã«ãªãã°å¹žãã§ãã
ã¬ã€ã¢ãŠãã·ãããšã¯
ã¬ã€ã¢ãŠãã·ããã¯ããŠã§ãããŒãžãããŒããããåŸã«ããŒãžäžã®èŠèŠçèŠçŽ ãäºæããåã(ã·ãããã)çŸè±¡ã§ããã¬ã€ã¢ãŠãã·ããã¯ããŠãŒã¶ãŒã«ãšã£ãŠã¯ãäºæããªãçŸç¶ãªã®ã§ãWebããŒãžã®èªã¿èŸŒã¿äžãæäœäžã«èµ·ãããšã䜿ãåæã倧ããæããå¯èœæ§ããããŸãã
äŸãã°ãããã¹ããèªãã§ãããšãã«ç»åãåºåãé ããŠèªã¿èŸŒãŸãããã®çµæããã¹ãããããããšããããŸãããã®çµæããŠãŒã¶ãŒã®éäžã劚ãã誀ã¯ãªãã¯ãåŒãèµ·ããå¯èœæ§ããããŸãã
CLSãšã¯
CLS(Cumulative Layout Shift)ã¯ãWebããŒãžã®é²èŠ§æã«ã¬ã€ã¢ãŠãã·ãããã©ãã ãçºçããŠãããã瀺ãã¹ã³ã¢ã§ããããŠãŒã¶ãŒäœéšã®è³ªã枬ãäžã€ã®åºæºãšãªããŸãã
CLSã¯0ããå§ãŸããæ°å€ã倧ããã»ã©ããŒãžäžã§å€ãã®ã¬ã€ã¢ãŠãã·ãããçºçããŠããããšãæå³ããŸãããã®ã¹ã³ã¢ãå¯èœãªéãäœãæããããšãæšå¥šãããŸãã
ãã¬ã€ã¢ãŠãã·ããçºçç®æããããããããŒããŒã«ã§ç¢ºèªããæ¹æ³01
Google Chromeã®ããããããŒããŒã«ã§ã¬ã€ã¢ãŠãã·ãããçºçããŠããç®æã確èªããæé ã以äžã«ç€ºããŸãã
ãã¬ã€ã¢ãŠãã·ããçºçç®æãã確èªããæ¹æ³
- Google Chromeã®ããããããŒããŒã«ãéã
- ããããããŒããŒã«ã®å³äžã«ãã瞊äžç¹ãªãŒããŒ(â®)ãã¯ãªãã¯ãã
- 衚瀺ããããŠã£ã³ããŠã§ãLayout Shift Regionsãã«ãã§ãã¯ãå ¥ãã
- WebããŒãžãéããŠãã¬ã€ã¢ãŠãã·ããã確èªãã
Google Chromeã®ããããããŒããŒã«ãéã
Windowsã®å ŽåãCookieã確èªããã察象ã®WebããŒãžã衚瀺ããç¶æ ã§ãGoogle ChromeãéãããF12ããŸãã¯ãCtrlã+ãShiftã+ãIããæŒããšãGoogle Chromeã®ããããããŒããŒã«ãèµ·åããŸã(Macã®å Žåããoptionã+ãcommandãïŒãIããæŒããŸã)ã
è£è¶³
- WebããŒãžå ã§ãå³ã¯ãªãã¯ããã¯ãªãã¯ããŠè¡šç€ºãããã¡ãã¥ãŒã®äžãããæ€èšŒããéžæããŠããGoogle Chromeã®ããããããŒããŒã«ãèµ·åããããšãã§ããŸãã
- Webãã©ãŠã¶å³äžã®äžç¹ãªãŒããŒ(瞊ã®äžã€ã®ç¹)ãã¯ãªãã¯ããããã®ä»ã®ããŒã«ãâãããããããŒããŒã«ããéžæããŠããGoogle Chromeã®ããããããŒããŒã«ãèµ·åããããšãã§ããŸãã
ããããããŒããŒã«ã®å³äžã«ãã瞊äžç¹ãªãŒããŒ(â®)ãã¯ãªãã¯ãã
瞊äžç¹ãªãŒããŒ(â®)ãã¯ãªãã¯ããŠéããã¡ãã¥ãŒã§ãMore toolsãâãRenderingããã¯ãªãã¯ããŸãã
衚瀺ããããŠã£ã³ããŠã§ãLayout Shift Regionsãã«ãã§ãã¯ãå ¥ãã
ãRenderingããã¯ãªãã¯ãããšãæ°èŠã«ãŠã£ã³ããŠã衚瀺ãããŸãã衚瀺ããããŠã£ã³ããŠã§ãLayout Shift Regionsãã«ãã§ãã¯ãå ¥ããŸãã
WebããŒãžãéããŠãã¬ã€ã¢ãŠãã·ããã確èªãã
ãã®ç¶æ ã§ãã¹ããããWebããŒãžãéããšãã¬ã€ã¢ãŠãã·ãããçºçããç®æãéè²ããã¯ã¹ã§è¡šç€ºãããããã«ãªããŸããéè²ããã¯ã¹ã¯ã³ã³ãã³ãã®èªã¿èŸŒã¿äžã«è¡šç€ºãããã®ã§ãã¬ã€ã¢ãŠãã·ãããçµäºãããšé衚瀺ã«ãªããŸãã
ãªããåç·é床ãéãå ŽåããµãŒããŒã®ã¬ã¹ãã³ã¹ãæ©ãå Žåã«ã¯ãéè²ããã¯ã¹ãäžç¬ã§æ¶ããŠããŸãã®ã§ãã¬ã€ã¢ãŠãã·ãããçºçãããã©ããããã¹ãããã®ãé£ããã§ãããã®å Žåã«ã¯ã以äžã®æ¹æ³ã§NetworkãCPUãé ããããããã£ãã·ã¥ãç¡å¹åããããšãããããããŸãã
NetworkãCPUãé ãããæ¹æ³
Google Chromeã®ããããããŒããŒã«ã®äžéšã«ããã¿ãã®äžãããPerformanceãã¿ããã¯ãªãã¯ããŠããPerformanceãã¿ãã«ç§»åããŸãããã®åŸãå³äžã«ããã®ã¢ããŒã¯ãã¯ãªãã¯ãããšãNetworkãCPUãéžæããããšãã§ããŸãã
Networkã¯Fast 3GãSlow 3Gãªã©ãéžã¹ãŸãããŸããCPUã¯4x slowdownãªã©ãéžã¹ãŸãã
ãã£ãã·ã¥ãç¡å¹åããæ¹æ³
Google Chromeã®ããããããŒããŒã«ã®äžéšã«ããã¿ãã®äžãããNetworkãã¿ããã¯ãªãã¯ããŠããNetworkãã¿ãã«ç§»åããŸãããã®åŸããDisable cacheãã«ãã§ãã¯ãå ¥ãããšããã£ãã·ã¥ãç¡å¹åãããããšãã§ããŸãã
ãã¬ã€ã¢ãŠãã·ããçºçç®æããããããããŒããŒã«ã§ç¢ºèªããæ¹æ³02
以äžã®æé ã§ãGoogle Chromeã®ããããããŒããŒã«ã§ã¬ã€ã¢ãŠãã·ãããçºçããŠããç®æã確èªããããšãã§ããŸãã
ãã¬ã€ã¢ãŠãã·ããçºçç®æãã確èªããæ¹æ³
- ãPerformanceãã¿ãã«ç§»åãã
- ãRecordããã¿ã³ãã¯ãªãã¯ããããŒãžã®èªã¿èŸŒã¿ãèšé²ãã
- ã¬ã€ã¢ãŠãã·ããã確èªãã
ãPerformanceãã¿ãã«ç§»åãã
Google Chromeã®ããããããŒããŒã«ã®äžéšã«ããã¿ãã®äžãããPerformanceãã¿ããã¯ãªãã¯ããŠããPerformanceãã¿ãã«ç§»åããŸãã
ãRecordããã¿ã³ãã¯ãªãã¯ããããŒãžã®èªã¿èŸŒã¿ãèšé²ãã
Google Chromeã®ããããããŒããŒã«ã®å·Šäžã«ãããRecordããã¿ã³(åãã¿ã³)ãã¯ãªãã¯ããããŒãžããªããŒãããŸãããããšãããŒãžã®èªã¿èŸŒã¿ãšã€ã³ã¿ã©ã¯ã·ã§ã³ãèšé²ãããŸããå¿ èŠãªããŒã¿ãéãŸã£ããããStopããã¿ã³ãã¯ãªãã¯ããŠèšé²ãåæ¢ããŸãã
ã¬ã€ã¢ãŠãã·ããã確èªãã
ãStopããã¿ã³ãã¯ãªãã¯ããåŸãã¿ã€ã ã©ã€ã³äžã§ãã¬ã€ã¢ãŠãã·ãããèµ·ããŠããç®æãæ¢ããŸãã
ãCLSããããããããŒããŒã«ã§ç¢ºèªããæ¹æ³
Google Chromeã®ããããããŒããŒã«ã§CLSã¹ã³ã¢ã枬å®ããæé ã以äžã«ç€ºããŸãã
ãCLSã¹ã³ã¢ãã確èªããæ¹æ³
- ãLighthouseãã¿ãã«ç§»åãã
- WebããŒãžã衚瀺ãããAnalyze page loadããã¿ã³ãã¯ãªãã¯ãã
ãLighthouseãã¿ãã«ç§»åãã
Google Chromeã®ããããããŒããŒã«ã®äžéšã«ããã¿ãã®äžãããLighthouseãã¿ããã¯ãªãã¯ããŠããLighthouseãã¿ãã«ç§»åããŸãã
WebããŒãžã衚瀺ãããAnalyze page loadããã¿ã³ãã¯ãªãã¯ãã
CLSã¹ã³ã¢ã枬å®ãããWebããŒãžã衚瀺ãããAnalyze page loadããã¿ã³ãã¯ãªãã¯ããŸã(CLSã¹ã³ã¢ã¯Performanceã«ããŽãªã«åé¡ãããã®ã§ãPerformanceã«ã ããã§ãã¯ãå ¥ããŠãOKã§ã)ã
ãAnalyze page loadããã¿ã³ãã¯ãªãã¯ãããšãPage Speed Insightsã«äŒŒããã®ã衚瀺ãããCLSã¹ã³ã¢ã衚瀺ãããŸãã
CLSã¹ã³ã¢ã¯æ°å€ãå°ããã»ã©è¯ãã§ãã
æ¬èšäºã®ãŸãšã
ãã®èšäºã§ã¯ãã¬ã€ã¢ãŠãã·ããããšãCLSãã«ã€ããŠã以äžã®å 容ã説æããŸããã
- ã¬ã€ã¢ãŠãã·ãããšã¯
- CLSãšã¯
- ãã¬ã€ã¢ãŠãã·ããçºçç®æããããããããŒããŒã«ã§ç¢ºèªããæ¹æ³
- ãCLSããããããããŒããŒã«ã§ç¢ºèªããæ¹æ³
ãèªã¿é ãããããšãããããŸããã