Web パフォーマンスは客観的な測定値であり、ロード時間とランタイムに関するユーザーエクスペリエンスの認知度です。Web パフォーマンスとは、サイトがロードされ、対話型になり、応答性が向上するまでにかかる時間と、ユーザーとの対話中にコンテンツがどの程度スムーズになるかです - スクロールはスムーズですか？ ボタンはクリック可能ですか？ ポップアップはすばやく開くことができますか？ また、ポップアップはスムーズにアニメートしますか？ Web パフォーマンスには、読み込み時間、1秒あたりのフレーム数、対話時間までの客観的な測定値と、コンテンツの読み込みに要した時間の主観的な経験の両方が含まれます。
Web パフォーマンスの測定と改善に役立つツール、API、およびベストプラクティスがあります。 このセクションでそれらをカバーします
The MDN Web Performance Learning Area contains modern, up-to-date tutorials covering Performance essentials:
- What is web performance
- This article starts the module off with a good look at what Performance actually is — this includes the tools, metrics, APIs, networks, and groups of people we need to consider when thinking about performance, and how we can make Performance part of our web development workflow.
- Critical rendering path
- Some attributes and the source order of your markup can impact the performance or your website. By minimizing the number of DOM nodes, making sure you use the best order and attributes for included content such as styles, scripts, media, and third-party scripts, you can drastically improve the user experience. This article looks in detail at how HTML and the critical rendering path one can use to ensure maximum performance.
- Multimedia: Images and Video
- Frequently, media optimization is the lowest hanging fruit of web performance. Serving different media files based on each user agent's capability, size, and pixel density is possible. Additional tips, like removing audio tracks from background images, can improve performance even further. In this article, we discuss the impact video, audio, and image content has on performance, and the methods to ensure that impact is as minimal as possible.
- CSS performance features
- CSS may be a less important optimization focus for improved performance, but there are some CSS features that impact performance more than others. In this article, we look at some CSS properties that impact performance and suggested ways of handling styles to ensure performance is not negatively impacted.
- How do users perceive performance?
More important than how fast your website is in milliseconds, is how fast do your users perceive your site to be. Page load time, idling, responsiveness to user interaction, and the smoothness of scrolling and other animations impact these perceptions. In this article, we discuss the various loading metrics, animation, and responsiveness metrics, along with best practices to improve user perception, if not the actual timings.
- Web Performance Basics
- Mobile performance
- With web access on mobile devices being so popular, and all mobile platforms having fully-fledged web browsers, but possibly limited bandwidth, CPU and battery life, it is important to consider the performance of your web content on these platforms. This article looks at mobile-specific performance considerations.
- Populating the page
- Performance bottlenecks
- Time to Interactive
- Understanding latency
Latency is the amount of time it takes between the browser making a request for a resource, and the browser receiving back the first byte of the resource requested. This article explains what latency is, how it impacts performance, and how to measure and improve latency.
- Understanding bandwidth
Bandwidth is the amount of data (measured in Mbps or Kbps) that one can send per second. This article explains the role of bandwidth in media-rich internet applications, how you can measure it, and how you can optimize applications to make the best use of available bandwidth.
- HTTP/2 and you
The transport layer—that is, HTTP—is utterly essential to the functioning of the web, and it has only been relatively recently that it has seen a major update in the form of HTTP/2. Out of the box, HTTP/2 provides many performance improvements and advantages over its predecessor, but it also changes the landscape. In this article, you'll learn what HTTP/2 does for you, and how to fine-tune your application to make it do go even further.
- The role of TLS in performance
TLS—or HTTPS as we tend to call it—is crucial in creating secure and safe user experiences. While hardware has reduced the negative impacts TLS has had on server performance, it still represents a substantial slice of the time we spend waiting for browsers to connect to servers. This article explains the TLS handshake process, and offers some tips for reducing this time, such as OCSP stapling, HSTS preload headers, and the potential role of resource hints in masking TLS latency for third parties.
- Reading performance charts
- Developer tools provide information on performance, memory, and network requests. Knowing how to read waterfall charts, call trees, traces, flame charts , and allocations in your browser developer tools will help you understand waterfall and flame charts in other performance tools.
- Lazy loading
- It isn't always necessary to load all of a web applications assets on initial page load. Lazy Loading is defering the loading of assets on a page, such as scripts, images, etc., on a page to a later point in time – when those assets are actually needed.
- Controlling resource delivery with resource hints
- Browsers often know better than we do when it comes to resource prioritization and delivery—but they're far from clairyovant. Native browser features enable us to hint to the browser when it should connect to another server, or preload a resource before the browser knows it ever needs it. When used judiciously, this can make fast experience seem even faster. In this article, we cover native browser features like rel=preconnect, rel=dns-prefetch, rel=prefetch, and rel=preload, and how to use them to your advantage.
- The business case for web performance
You know web performance is important, but how do you convince clients and management to invest in performance and make it a priority. In this article, we'll discuss creating a clear business case to convince decision-makers to make the investment.
- Performance Budgets
- Marketing, design, and sales needs, and developer experience, often ad bloat, third-party scripts, and other features that can slow down web performance. To help set priorities, it is helpful to set a performance budget: a set of restrictions to not exceed during the development phase. In this article, we'll discuss creating and sticking to a performance budget.
- Mobile performance checklist
- A concise checklist of performance considerations impacting mobile network users on hand-held, battery operated devices.
- Optimizing Startup Performance
- How long does your app take to start up? Does it lock up the browser while loading? Take the time to ensure your app starts up nicely. This article offers tips and suggestions to help you achieve that goal.
- Developer Tools Performance Features
- This section provides information on how to use and understand the performance features in your developer tools, including Waterfall, Call Tree, and Flame Charts.
- Understanding Latency
- Latency is the amount of time it takes between the browser making a request for a resource, and the browser receiving back the first byte of the resource requested. This article explains what latency is, how it impacts performance, how to measure latency, and how to reduce it.
- Web performance checklist
- A performance checklist of features to consider when developing applications with links to tutorials on how to implement each features, include service workers, diagnosing performance problems, font loading best practices, client hints, creating performant animations, etc.
- Performance Monitoring: RUM vs synthetic monitoring
- Sythentic and RUM are two different approaches for monitoring web performance. In this article we define and compare these two performance monitoring approaches.
- Performance fundamentals
- A wide overview of Web application performance, what it is, how the browser helps to improve it, and what tools and processes you can use to test and further improve it.
- Optimizing startup performance
- Tips and suggestions to help you improve startup performance, both when writing a new app and when porting an app from another platform to the Web.
- Profiling with the built-in profiler
- Learn how to profile app performance with Firefox's built-in profiler.
- Preloading content with
rel="preload"- (https://w3c.github.io/preload/ )
- GPU v CPU
- Measuring layout
- font-loading best practices
- Performance API
- Navigation Timing API
- Media Capabilities API
- Network Information API
- Battery Status API
- Intersection Observer
- Using the User Timing API
- Long Tasks API
- High Resolution Timing API (https://w3c.github.io/hr-time/)
- Resource Timing API
- Page Visibility
- Cooperative Scheduling of Background Tasks API
- Beacon API
- Resource Hints - dns-prefetch, preconnect, prefetch, and prerender
- Performance Server Timing API
- Performance in Firefox Developer Tools
- Flame charts
- the Network panel
- waterfall charts
- Speed Index and Perceptual Speed Index