Prefetching Link dengan HTML5

July 29, 2010

Salah satu ambisi seorang pengembang browser dan pengembang web adalah penjelajahan situs web yang lebih cepat. Beberapa teknik telah diimplementasikan sehari-hari seperti teknik optimasi CSS dan Image, teknik caching lebih lama dengan htaccess, kompresi file javascript, penggunaan CDN dll. Dalam tulisan ini, saya coba memperkenalkan teknik optimasi yang diperkenalkan oleh Firefox terbaru yaitu Link Prefetching.

Apa itu Link Prefetching

Link prefetching is a browser mechanism, which utilizes browser idle time to download or prefetch documents that the user might visit in the near future. A web page provides a set of prefetching hints to the browser, and after the browser is finished loading the page, it begins silently prefetching specified documents and stores them in its cache. When the user visits one of the prefetched documents, it can be served up quickly out of the browser’s cache. — MDC

Singkat kata, Link Prefetching adalah mekanisme browser yang memberdayakan kesiagaan browser untuk mengunduh atau memuat dokumen yang kemungkinan besar akan digunakan/diakses kemudian hari oleh pengguna. Teknik Prefetching Link ini baru tersedia pada HTML5.

Contoh

Contohnya:

<!-- full page -->
<link rel="prefetch" href="http://emka.web.id/articles" />

<!-- just an image -->
<link rel="prefetch" href="http://emka.web.id/images/download.png" />

Prefetching dilakukan dengan tag LINK dan mencantumkan “prefetch” sebagai nilai dari variabel rel dan kemudian URL/Path ke tujuan. Disamping sintaks tersebut, Mozilla juga memperkenalkan attribut rel yang lain yaitu alternate, stylesheet, dan next. Prefetching juga bisa berlaku untuk protokol HTTPS.

Catatan

- prefetching berlaku untuk kasus antar-domain termasuk mengambil cookie dari situs tersebut,
- prefeching cukup merugikan web yang dituju karena relatif tak mempengaruhi statistik pengunjung,
- hanya Firefox yang mendukung teknologi ini.

Related Articles

  • Random Articles

Leave a Reply




Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).