hyttefeber / dawn

Shopify's first source available reference theme, with Online Store 2.0 features and performance built-in.
Other
0 stars 1 forks source link

Tasteful preloading #44

Open prebenpreben opened 2 years ago

prebenpreben commented 2 years ago

Describe the enhancement you'd like The site is pretty heavy atm, and TTFB is way too high. Can we implement some form of preloading? Should help quite a bit.

I have tried instant.page in the past, but it was hard to determine if it was working as intended and didn't mess up anything. It needs to preload link on hover after 35ms or so.

Describe alternatives you've considered I have considered using an app for this. (https://apps.shopify.com/page-speed-optimizer) Also considered this:

Additional context/screenshots Maybe a screenshot or design?

olafghanizadeh commented 2 years ago

TTFB is mainly caused by slow DNS or server response time. Preloading assets won't fix that. I'll look into if there are any assets that is slowing down the loading considerably.

prebenpreben commented 2 years ago

Well. Having a ton of scripts and assets in the without deferring and loading asynchronously increases TTFB dramatically. I wasn't referring to preloading certain assets to up the priority in the loading que though, but preloading entire links on hover.

Like this one does: (https://instant.page/)

For me it took 250-300ms from I hovered the button, to clicking it. And it felt like a pretty fast click too. Medium/slower ones where 500-700ms. So doing this might help the site feel faster to a great extent. If there is a 1 second delay before anything happens every time you click something, you will notice if it drops 250-700ms 🤠

I have tried instant.page on Shopify in the past, and it seemed to work. The site was noticeably faster for me, but I was scared I might have broken something since CR didn't seem to go up. And instant.page is a generic script not tailored to Shopify.

olafghanizadeh commented 2 years ago

Understood. It will give the impression of the page being faster, but this alone won't change the performance metrics.