Search code examples
htmlprefetch

Is excessive use of prefetch bad?


Just read this article on prefetching, and it states:

Of course, you have to be careful (Don’t prefetch your entire website!)

I just wondered, why? If the work is going on behind the scenes, why not just have the machine quietly collecting your whole site?

I am assuming this is just so as not to dominate the end users resources, but have I missed something?


Solution

  • Yes. It's not useful to prefetch or even worse prerender everything in most cases, as the user might not even visit the page.

    This is out of consideration for their bandwidth as well as for your sake.

    As an example, some would consider prerendering all of the full blog posts from a list of snippets. That isn't useful to the user, as it fills their memory with rendered pages that most likely will be discarded.

    Only prerender links you are 90% sure the user will click on. Prefetching resources isn't as bad, but still you only want to do it for things you are sure the user needs.