What is prefetch? This is very interesting thing in html for sites performance. As name says: suppose you are viewing “abc.html” and as a developer I know there are a high probably that after this page you will visit “xyz.html”, my trick will be here is to prefetch “xyz.html” while you are viewing “abc.html”.
How to achieve? Very easy. Just add <link rel=”prefetch” href=”xyz.html”> in head of your “abc.html” page. What it does is:when browser see this it starts fetching in background.
Browser support: Firefox and chrome supports it (chrome in a different way) (http://www.catswhocode.com/blog/mastering-html5-prefetching) <link rel=”prerender” href=”xyz.html”> in chrome
How other browser will behave if I use it? Don’t worry. If a question asked by a teacher in a class students knows the answer will up their hands and others will keep quiet :). Same here. Browser which doesn’t support it will keep quiet. Though they will not be able to prefetch the page ( or image or whatever it is).
Issues with it: Once I had an issue. In a project I needed to store current page url in session whenever a page renders. But whenever I was accessing “abc.html”, in session I was getting “xyz.html”. Yes you caught it correct, its because though I was accessing “abc.html” first in session it was keeping “abc.html” and within fraction of second when browser tries to access “xyz.php” in background due to prefetch, session was getting updated by “xyz.html”.
Choose to use it according to project spec and be one step ahead in this fast internet world.