Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Improving Core Web Vitals using Speculation Rul...

Improving Core Web Vitals using Speculation Rules API

In this session Sergey Chernyshev talks about a technology available in Google Chrome called Speculation Rules API.

We look at why it is so groundbreaking, how it can be used by web developers to greatly optimize their site’s load and rendering times and what are the aspects they need to consider when implementing it.

Finally, we discuss how it improves the User Experience Speed and corresponding Core Web Vitals and how much websites can benefit from using this technology.

Sergey Chernyshev

December 06, 2024
Tweet

More Decks by Sergey Chernyshev

Other Decks in Technology

Transcript

  1. I P1 C Load Render P2 C Load Render Speculation:

    Moderate Prefetch (Desktop) LCP
  2. I P1 C Load Render P2 C Load Render Speculation:

    Moderate Prerender (Desktop) LCP
  3. Safe Speculation Make sure speculation requests are safe to make

    - avoid stateful GET requests like: • Sign-out & Language switching URLs. • "Add to cart" URLs. • Server-side action URLs, e.g. sending an SMS & etc Filter the pages in the Speculation Rules. Watch Sec-Purpose HTTP request header for “prefetch” or “prerender”. Send an error response code from server to cancel speculation if necessary. For unsafe client code, use prerenderingchange to attach JS code.
  4. 45% LCP improvement “Cloudflare currently has tens of millions of

    domains using Speed Brain. We have measured the LCP at the 75th quantile (p75) for these sites and found an improvement for these sites between 40% and 50% (average around 45%).” – Cloudflare Speed Brain announcement https://blog.cloudflare.com/introducing-speed-brain/