As some of you may know, FireFox has the option to prefetch webpages.
Now from the docs :
<link rel="prefetch alternate stylesheet" href="mozspecific.css">
<link rel="next" href="2.html">
Now from what i understand, anything you prefetch will be prefetched, however when should i use the prefetch rel and when to use the next?
Meaning how will all my links look like when trying to prefetch multipile resources?
rel="prefetch"
is for things (styles, scripts, images) that the current page is likely to require soon and that are better be cached already. rel="next"
is for web pages that the user is likely to navigate next. It's as simple as that.
From HTML5 standard:
The
prefetch
keyword indicates that preemptively fetching and caching the specified resource is likely to be beneficial, as it is highly likely that the user will require this resource.
And a bit below:
The
next
keyword indicates that the document is part of a sequence, and that the link is leading to the document that is the next logical document in the sequence.
So rel="next"
doesn't inherently indicate that this web page needs to be prefetched - Firefox might choose to do it however because the user will likely navigate to it next (not sure whether it is currently happening).