Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Advancement core Web vitals and SPA ?

261 views
Skip to first unread message

Alexandre Joffre

unread,
Jun 22, 2023, 11:58:36 AM6/22/23
to web-vitals-feedback
Hello
From what I understand, to date we have no reliable Core Web Vitals indicator to measure performance on a SPA site and even less to compare it to an MPA site.

The INP seems the most relevant. Do you agree with this approach? Is there an improvement agenda for taking LCP into account for a SPA application?

THANKS,
Alexander

Michal Mocny

unread,
Jun 22, 2023, 12:27:36 PM6/22/23
to Alexandre Joffre, web-vitals-feedback
Indeed, the Chrome User Experience (CrUX) report, does not currently measure SPA navigations (no new LCP), nor does it slice full page lifecycle metrics (like INP or CLS) on SPA routes.  (Thus, neither does pagespeed insights etc)

However, the performance data that powers those metrics are exposed to the web via Performance APIs such that you are able to gather your own field data.  So, if it is important for you to understand your field metrics and you are already collecting this via some RUM data provider (or rolling your own simple collection, perhaps using web-vitals.js) -- it is possible, perhaps even relatively easy, to slice on SPA routes yourself.

There are several projects underway to do what you ask for: automatic soft-navigation detection, LCP events post soft-navigation, and INP/CLS slicing based on route change.  I would not expect such data to be available to CrUX in any predictable time frame, however, you can test these features in Chrome, either locally just by enabling experimental-web-platform features, or in the field via Origin Trial on Chrome right now (ending very soon, perhaps will be extended...).

Cheers!

--
You received this message because you are subscribed to the Google Groups "web-vitals-feedback" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-vitals-feed...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web-vitals-feedback/3de01b41-cc7e-4bb1-8f24-fb2f7c8b4ed5n%40googlegroups.com.

Barry Pollard

unread,
Jun 22, 2023, 12:56:29 PM6/22/23
to Michal Mocny, Alexandre Joffre, web-vitals-feedback
Yes the Soft Navs origin trail is being extended btw. We really value feedback on that if we want to make progress on solving this issue.
Feedback can be submitted by raising bugs at https://crbug.com/new or issues for discussion here: https://github.com/WICG/soft-navigations/issues.

Ravi Roshan

unread,
Sep 1, 2023, 3:13:39 AM9/1/23
to web-vitals-feedback
Hi Team,

I was going through this section on web.dev which covers unfair advantage of MPA over SPA. Two potential solutions are mentioned and one of those is "Design new APIs that enable better SPA measurement (Long Term solution)" and more details for experiments were added for that here. It seems like this experiment was concluded with the outcome "CrUX will continue to report the metrics in the existing manner regardless of this soft navigation setting so is not impacted by those implications".

Could you also provide some details & timeline on the progress of proposed short term solution "Assess cross-origin and same-origin page visits separately." and how will it impact CrUX data?

Barry Pollard

unread,
Sep 1, 2023, 3:29:17 AM9/1/23
to Ravi Roshan, web-vitals-feedback
As noted in that experimentation article:

The Soft Navigations origin trial has now ended. The Chrome team are taking onboard the feedback received and will be making some adjustments and are aiming to relaunch a second origin trial from Chrome 117 (due for release in September 2023) for further feedback.

So, looking to relaunch this second origin trial in the next month.

We are still looking for further feedback on the origin trials before any further decisions are made.

Barry

Ravi Roshan

unread,
Sep 1, 2023, 1:44:37 PM9/1/23
to web-vitals-feedback
Thank you for the prompt response Barry. If I understand this correctly, below is the current status on these initiatives (please confirm)

  1. "Design new APIs that enable better SPA measurement (Long Term solution)" : Trial has ended, and will be restarting it next month.
  2. "Assess cross-origin and same-origin page visits separately (Short Term solution) : No change/progress on this yet and no impact on CrUX data from this initiative .

Barry Pollard

unread,
Sep 4, 2023, 10:17:07 AM9/4/23
to Ravi Roshan, web-vitals-feedback
Yes, that is correct. At present we are concentrating our efforts on being able to better measure SPA navigations and I'm not aware of any plans to treat cross-origin and same-origin page views differently (though this was looked into at the time of that post's publication).



Nazario Fraija Pulido

unread,
Sep 6, 2024, 3:01:59 PM9/6/24
to web-vitals-feedback
Hello everyone,

Would anyone help me with these 2 questions 
1. I'd like to know what are the best guideline to track CLS in an SPA. 
2. Is CLS a metric meant for browsing layout shifts between page navigations and page loads, how about layout shifts in interactions in one screen?

Thank you

Barry Pollard

unread,
Sep 6, 2024, 3:11:32 PM9/6/24
to Nazario Fraija Pulido, web-vitals-feedback
Would anyone help me with these 2 questions 
1. I'd like to know what are the best guideline to track CLS in an SPA. 

This is theoretically possible since, unlike LCP, layout shifts are continually reported by the underlying Layout Instability API so you could measure them as you see fit and report them for each soft navigation in the SPA. The main issue will be attributing the layout shifts to the appropriate route in the SPA, especially if they are reported after a page transition.

This is why the soft navigation experiment we are working on includes URL attribution as well as other changes. But this is not ready for production use, but experimentation and feedback on this is very welcome.

So at the moment there is no easy way to track CLS within an SPA except treating it all as one page and reporting the CLS for the whole "single page".
 
2. Is CLS a metric meant for browsing layout shifts between page navigations and page loads, how about layout shifts in interactions in one screen?

I'm not sure I understand the question. CLS is intended to measure all shifts, except user generated shifts. It does not differentiate between shifts happening during page load and those happening later. The one exception is same-page "user generated shifts" within 500ms are excluded so for an SPA you may see less CLS than for an equivalent MPA since those soft navigations will count as a user interaction, whereas they won't for an MPA. But 500ms is quite a short time frame for that so likely they would be counted for both in many cases.

Generic VIlla

unread,
Sep 27, 2024, 5:46:03 AM9/27/24
to web-vitals-feedback
why not showing here report 

Screenshot_3.png
Reply all
Reply to author
Forward
0 new messages