DEV Community

Promoting Perceived Performance with Prefetching

Brian Rinaldi on April 25, 2019

There will always be a difference between how your site actually performs versus how people perceive it to be performing. This perceived performanc...
Collapse
 
raymondcamden profile image
Raymond Camden

Heya! Two questions for you:

1) "There are also a bunch of customization options. By default the library uses XHR to load all the links but you can ask it to use the fetch API and fall back on XHR:"

Any reason for this? I mean as a developer, I love Fetch. But as a user of this library, why would I tell it to use one over the other outside of needing support for older browsers? (Or is that it?)

2) "My local demo doesn't do the technique justice since everything locally loads quickly"

I assume you tested with network throttling in Chrome Devtools? That didn't show a change? If so I'd consider it a bug.

Collapse
 
remotesynth profile image
Brian Rinaldi

In answer to 1. No idea, since it falls back on XHR anyway. I had the same question myself.

As for 2, the page is a bit too simple that even with network throttling, it loads fast - as in, there seemed to be a difference between the preloaded and non-preloaded times but it was minor enough that I could have been imagining it...and since we are talking about perceptions here, it's hard to say definitively.

Collapse
 
pavelloz profile image
Paweł Kowalski • Edited

There is also third thing, by G, that uses GA to do predictive preload using machine learning from GA users behavior. In combination with webpack can be good thing of you use GA. ;)

Guess.js its called, or something similar.