Both Mozilla and FireFox have the ability to prefetch contect on a web page. This basicly means that while you're browsing, the browser is downloading other content in the background.
To tell your sites content to be prefeched you must tell your browser to do so. If you had a large header image on another page you wanted prefeched, just enter:
Code:
<link rel="prefetch" href="images/head.png">
Put that into the <head> section of your code. The browser will prefetch the image and save it into the cache.
If you also wanted your other page prefetched too, just copy this code under it:
Code:
<link rel="next" href="other.html">
It's a great way to make the end user think that your site is loading quickly, they click the link to the next page and it will load instantly from the cache.
Links with
https wont be prefetched for security reasons and dynamicly generated pages with query strings in the url will also not be prefetched...they generally cant be cacheable so it makes pefect sense not to.
Watch out though...prefetching can cause havoc in your site backend. It will click every link on the page, no matter what it is...this may include buttons such as "Delete" or "Add", so you have been warned!
To completely turn off Prefetching, add this code to your .htaccess file:
Code:
RewriteEngine On
SetEnvIf X-moz prefetch HAS_X-moz
RewriteCond %{ENV:HAS_X-mox} prefetch
RewriteRule .* /prefetch-attempt [L] Simple.
I hope you enjoyed this prefetching tutorial, it can do wonders with your site, but I'd also keep an eye out on bandwidth too...