Skip to Content
AI時代のWebパフォーマンス・エンジニアリング ―速度と品質の最適化
book

AI時代のWebパフォーマンス・エンジニアリング ―速度と品質の最適化

by Addy Osmani, 株式会社ツークンフト・ワークス
November 2026
252 pages
3h 38m
Japanese
O'Reilly Japan, Inc.
Content preview from AI時代のWebパフォーマンス・エンジニアリング ―速度と品質の最適化

9章サードパーティスクリプトの読み込み

サードパーティスクリプト(分析プラットフォームから広告ネットワーク、ソーシャルメディアウィジェットからカスタマーサポートチャットボットまで)は現代のWebサイトに不可欠だ。しかし代償も伴う。8章ではサードパーティスクリプトの定義と重要性を扱ったが、本章ではそれらを効率的に読み込む方法に焦点を当てる。共通するテーマは「順序付け(シーケンス制御)」だ。最初に読み込むべきものを優先し、待てるものは遅らせる。あるいはユーザーの状況に応じて条件付きで読み込んだり、実際に必要になるまで重いリソースの読み込みを遅延させる「クリック・トゥ・ロード(click-to-load)」パターンを実装したりする。

サードパーティスクリプトを効果的に読み込むには、機能性とパフォーマンスのバランスが求められる。読み込みが早過ぎたり、不用意に読み込んだりすると、重要なコンテンツの表示をブロックし、初期ページレンダリングを遅らせてユーザーをいら立たせてしまう。逆に遅過ぎると、重要な分析データの収集を逃したり、ユーザーが期待する機能の提供に時間がかかる。本章で紹介する、async属性やdefer属性の使用、ファサードを用いた遅延読み込みの実装といったテクニックを使えば、サードパーティコンテンツがページに表示されるタイミングと方法を細かく制御できる。本章を読み終える頃には、サイトに必要な機能を維持しつつ、サードパーティスクリプトによるパフォーマンスへの影響を最小限に抑えるためのシーケンス手法を理解できるようになるだろう。

9.1 順序付けと優先順位付け

サードパーティスクリプト最適化の根本的な側面の1つは、ページの重要なコンテンツに対する相対的な読み込み・実行タイミングを制御することだ。AIによって生成されたHTMLは、読み込みタイミングを考慮せずに外部 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

The Hidden Cost of AI-Assisted Creativity

The Hidden Cost of AI-Assisted Creativity

Léonard Boussioux, Anil Doshi, Oliver Hauser, Kartik Hosanagar
How to Develop a Great Digital Strategy

How to Develop a Great Digital Strategy

Jeanne W. Ross, Cynthia M. Beath, Ina M. Sebastian
Workforce Ecosystem Orchestration: A Strategic Framework

Workforce Ecosystem Orchestration: A Strategic Framework

Elizabeth J. Altman, David Kiron, Robin Jones, Susan Cantrell, Steven Hatfield
How to Overcome a Power Deficit

How to Overcome a Power Deficit

Cyril Bouquet, Jean-Louis Barsoux

Publisher Resources

ISBN: 9784814401888Publisher Website