httparchive.org icon indicating copy to clipboard operation
httparchive.org copied to clipboard

Prerender report pages

Open rviscomi opened this issue 1 year ago • 2 comments

Uses Speculation Rules to eagerly prerender /reports/* pages

Bypasses lazy rendering of charts during prerendering

rviscomi avatar Jun 29 '24 00:06 rviscomi

This seems way too heavy. We’re prerendering all 10 reports (which is the absolute max allowed btw!) even though the user is at best case going to get value out of only one of those.

AND you’re removing your lazy loading option to give them the FULL load cost. For the CrUX report alone that’s 1.3MB.

This is likely to cause a big performance regression as the current page load and INP competes for network and CPU resources—particularly on slow devices.

I also think it sets a really bad example. I’m telling people not to overdo this, to think of their users, and that the 10 limit is a guard against sites going way too far, and not a target.

WDYT about instead prefetching the reports eagerly? And then prerendering all internal links less eagerly (moderate eagerness)? With the prefetch that should give it enough head start to improve navigations without making them download (and render charts for) ALL the data we show. We can also <link rel=prefetch> the highcharts libraries to further reduce delays so the moderate eagerness gets best change to complete even in that short window.

tunetheweb avatar Jun 29 '24 07:06 tunetheweb

Yeah I think you're right. I'll update.

rviscomi avatar Jul 01 '24 20:07 rviscomi

To close this out I've gone with a simpler approach:

  • Prefetch all reports eagerly (once visible—so when menu options).
  • Prerender with moderate eagerness (i.e. on hover) to get a bit of a headstart

tunetheweb avatar Dec 01 '24 12:12 tunetheweb