Jun 3, 2010

Link Prefetching with Firefox ..


You add a line like this to your page:
sry i cant use the link tag here , use link tag with the htmlpage ,image or anything as if u link a stylesheet.
Then the browser automatically downloads page2.html in a background process as soon as the user’s computer is idle. When the user finally clicks a link to page2.html, the browser serves it from the cache, and so it loads significantly faster.
Link prefetching is currently only supported by Firefox. But since Firefox is the second most popular web browser in the world, you can noticeably decrease load times for a significant chunk of your users just by adding one line of code to your HTML. Pretty cool, huh?
Here are some ways you could use link prefetching:
* Anytime you split content across multiple pages, as in large articles, online tutorials, image slideshows, etc.
* On your homepage to preload whatever page your users tend to click on next. (That could be the “features” page on a product site or your most recent entry on a blog.)
* On a search engine to prefetch the top result.
You can also use it for static content using the prefetch rel:
A couple other interesting points:
* Link prefetching will probably pop up in Opera, Chrome and Safari soon, and in Internet Explorer sometime around 2020.
* If this becomes popular it has the potential to skew logs and stats. Consider what happens when a bunch of prefetch requests are made to one of your pages, but the user never actually visits the page. The server (or stats package) doesn’t know the difference.
To clear this up, Firefox sends along an HTTP header, X-moz: prefetch, but you need some logic on the server side to detect it.
To learn more about link prefetching and see other examples, see the article about it on Mozilla’s site:https://developer.mozilla.org/en/link_prefetching_faq

No comments:

Post a Comment