HTML5プリフェッチ-ドキュメントのプリロード

すでに2003年に、Mozillaはページの読み込みを最適化する新しいメカニズムを導入しました。 そして、このテクノロジーがHTML5に移行する大きなチャンスがあります。



このメソッドの本質は、どのページでもブラウザがドキュメント(ページ、スタイルファイル、画像)を指定できることであり、ユーザーはすぐにそれを必要とするかもしれません。 そして彼は事前にそれらをキャッシュします。



rel = 'prefetch'属性を持つlinkタグでドキュメントにタグを付けることができます:

  1. <!-- --> < link rel = "prefetch" href = "http://www.example.com/" > <!-- --> < link rel = "prefetch" href = "/images/big.jpeg" > <!-- meta --> < meta http-equiv = "Link" content = "</images/big.jpeg> ; rel=prefetch">



  2. <!-- --> < link rel = "prefetch" href = "http://www.example.com/" > <!-- --> < link rel = "prefetch" href = "/images/big.jpeg" > <!-- meta --> < meta http-equiv = "Link" content = "</images/big.jpeg> ; rel=prefetch">



  3. <!-- --> < link rel = "prefetch" href = "http://www.example.com/" > <!-- --> < link rel = "prefetch" href = "/images/big.jpeg" > <!-- meta --> < meta http-equiv = "Link" content = "</images/big.jpeg> ; rel=prefetch">



  4. <!-- --> < link rel = "prefetch" href = "http://www.example.com/" > <!-- --> < link rel = "prefetch" href = "/images/big.jpeg" > <!-- meta --> < meta http-equiv = "Link" content = "</images/big.jpeg> ; rel=prefetch">



  5. <!-- --> < link rel = "prefetch" href = "http://www.example.com/" > <!-- --> < link rel = "prefetch" href = "/images/big.jpeg" > <!-- meta --> < meta http-equiv = "Link" content = "</images/big.jpeg> ; rel=prefetch">



  6. <!-- --> < link rel = "prefetch" href = "http://www.example.com/" > <!-- --> < link rel = "prefetch" href = "/images/big.jpeg" > <!-- meta --> < meta http-equiv = "Link" content = "</images/big.jpeg> ; rel=prefetch">







どこで使用できますか







現在のところ、この技術はFirefoxでしか動作しない(そして特定のセキュリティ上の問題もある)という事実にもかかわらず、この方法は最新のサイトやWebアプリケーションを最適化するための非常に適切なメカニズムのようです。 個人的には、これまたは同様のソリューションを、急速に進化するhtml5標準の一部にしたいと思います。



______________________

リンクのプリフェッチに関するFAQ
リンクのプリフェッチ(Wikipedia)



All Articles