Understanding Prefetching

This post describes an interesting concept called “Link Prefetching in Web Pages”. It talks about the ways to design Prefetching within your webpages and also talks about the issues attached with it.

What is meant by Prefetching in Web parlance?

In order to understand Prefetching, we need to understand how a web page with multiple objects like images, stylesheets etc is loaded by a Browser. In a usual scenario, we always have a web page designated as the HTML rendered by the browser. This webpage then has the embedded objects like images ( jpeg,gif,png etc) , stylesheets ( css ) etc. When the user makes a request for such a webpage, the first thing a web browser does is load the HTML. The browser then parses the HTML and asks for the different objects in a top-down fashion.

Skeleton of a Web Page.

Skeleton of a Web Page.

The above figure explains the request flow for a hypothetical web page with HTML, Images, FLV, Javascript and CSS. The numbers written against the component refers to the way they would be requested by the browser.

So if you have a script written at the top of the web page, that will get loaded first, then whatever next. What is important to understand is that the next request from the browser is made only when the first request has completed. This ways, the browser waits for the first object request to complete before issuing the next request. This leads to a lot of wait time, which in turn can make your website appear to be slow.

With Prefetching, the web browser tries to resolve this issue. When Prefetching is enabled, the browser requests for the first object (i.e. the html) and while it delivers and renders the response to the end user, also parses the HTML to figure out the next subsequent requests. It then makes those requests Asynchronously and stores the result in its browser cache. Therefore, the wait time between the two results is reduced. When the user actually asks for that content, all the browser has to do is give that object from its Cache. The object appears immediately, thereby giving an impression to the end user that the website is indeed fast. Read more about How to get data from the browser cache in Firefox.

How to design my HTML to enable link Prefetching?

The browser looks for either an HTML link tag or an HTTP Link: header with a relation type of either next or prefetch. An example using the link tag follows:

<link rel="prefetch" href="/images/big.jpeg">

The same prefetching hint using an HTTP Link: header:

Link: </images/big.jpeg>; rel=prefetch

The Link: header can also be specified within the HTML document itself by using a HTML meta tag:

<meta http-equiv="Link" content="&lt;/images/big.jpeg&gt;; rel=prefetch">

Please note that even if you dont have these special tags in place, some browsers/ applications can still prefetch your links.

I am a Web Administrator, How can i identify Prefetch requests from the Browser client?

Yes. Firefox sends a special request header X-moz: prefetch for Prefetch requests. You can setup your server to track these requests seperately or block them totally, as the case may be.

If you are a web admin and seeing lot of traffic on your server, firstly identify Prefetching requests from your Server Access Logs and then in order to take control of the situation related with prefetching process, decide upon a rescue strategy.

Do i need any special kind of Browser for the Prefetching to work?

Almost all the web browser these days, support Prefetching. All you need to ensure is that your browser supports prefetching and it is enabled. Test if your browser supports Prefetching.

Are there any issues with Prefetching?

There are no serious issues attached with Prefetching but yes, you may find your bandwidth being utilized for content which you might never actually view. 

The other issue is related to prefetching of certain links with topics which might be illegal in your geography.

Your Web site statistics data may become less reliable because of statistics registered for page hits that were never seen by the user

Can i disable Prefetching in Firefox? How do i disable Prefetching in Firefox?

Yes. Though, by default Prefetching is turned on in Firefox, but it can be disabled by following the steps mentioned below.

1.) Open the Firefox browser

2.) Type about:config in the address bar and press Enter

3.) Scroll down the resulting preference list to network.prefetch-next

Disabling Prefetching in Firefox

Disabling Prefetching in Firefox

4.) Double click network.prefetch-next so the value is set to false.

5.) Close Firefox and restart it to enable the change.

Can you list any other Softwares or Add-ons which use Prefetching technique to help me gain some time?

Well, there are many but the two most famous one’s are Google Web Accelerator and an interesting Firefox Add-On for speeding up Firefox called FasterFox.

References: Mozilla

Also Read: Firefox 3.1 to add Private Browsing feature

[How-To] Open Firefox Bookmarks Using Keywords

Mozilla Firefox: Get the data from your Cache

Do you store your passwords using Firefox?

You can follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Cheers

Vaibhav Pandey

Advertisements

[How-To] Test your VOIP speed and quality

Obviously you can’t rely on the advertised “upto” 8mbps speed for your broadband connection and this is where you need services for figuring out your broadband speed. However, the buck doesn’t stop there. Having a good broadband speed doesn’t necessarily guarantee you a good VOIP connection. This is when you need to go for a test of your broadband speed and the VOIP quality.

Voiptest.org offers a comprehensive test which measures the quality and performance of Internet connections for Voice over IP usage by simulating real VoIP sessions between our server and your computer. It also performs the bandwidth test to/from our server. After the test you can see results and comments about your connection quality in percentage scale.

All you need to do in order to run the test is as follows

1.) Point your browser to www.voiptest.org

Voiptest.org

Voiptest.org

2.) Click on the button which says ” Click to start MySpeed”.

Voiptest speed results

Voiptest speed results

Voiptest summary page

Voiptest summary page

3.) Once the test is complete. The website generates an interesting report with all the results for the download speed, upload speed, quality of service, jitter and packet loss for your broadband connection.

Go ahead and figure out if your broadband bill is really worth it.

Also read:Open DNS: A big DNS Cache

Windows XP: Speed up Folder Browsing.

Get a faster firefox: FASTERFOX

You can also follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Cheers

Vaibhav

Turn off Windows Messenger and improve your PC Performance

There are many windows processes which usually run in the background and thereby tend to eat up system resources and slow down the computer. In my previous post, you learnt how to process idle tasks in Windows.

One of the process which usually starts on its own by default whenever Windows starts is Windows Messenger. If you happen to be one of those who doesn’t use Windows Messenger ( like me 🙂 ) then its in your PC’s best interest that you turn off the Auto mode of Windows messenger which by default loads it into the memory and keeps running it in the background, irrespective of whether you use it or not.

Follow the steps below to disable Windows Messenger on Windows Startup.

1.) Open Windows Messenger by typing ‘msmsgs.exe’ at the Run or double clicking on the program icon under Programs Files folder.

Windows Messenger

Windows Messenger

2.) Click on Tools –> Options.

Windows Messenger Options Tab display

Windows Messenger Options Tab display

3.) Click on the tab which says ” Preferences”.

Disable auto startup for Windows Messenger

Disable auto startup for Windows Messenger

4.) De-select the checkbox which says ” Run Windows Messenger when Windows Starts”.

5.) De-select the checkbox which says ” Allow Windows Messenger to run in Background”.

Also read: Canon Powershot A470: No frills, entry level digital camera

[How-To] Find out the location of person using your Wireless network

You can follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Cheers

Vaibhav Pandey

Whats your broadband speed?

I usually get this question about the varying Broadband speed from many of my readers. The usual question goes like this

I am on a 512 kbps unlimited plan but still my download speed is not more than 64kbps 😦 . Do you have any clues. Is my ISP cheating? Where can i measure my actual broadband speed?

So here you go, The first thing to remember is that most of the ISP’s sell the speed as upto speed and not a guaranteed speed. Also, upto speed usually is not the speed we get most of the times. In such scenarios if you really wish to test your current internet speed, Speedtest.net is for you.

Speedtest.net is a broadband connection analysis tool with a huge selection of geographically dispersed testing servers. Speedtest.net measures the performance of your broadband connection. At the end of each test, you are presented with the download (the speed of data from the server to your computer) and upload (the speed of sending data from your computer to the server) bandwidth speeds. The tests are performed completely within your web browser over HTTP (just like normal web browsing).

Speed test results can be shared over the internet

Speedtest.net initially recommends a server based on what it thinks is the shortest physical distance between you and one of the servers. However, because the Internet does not operate in direct paths, this recommendation may not be ideal. To best utilize Speedtest.net, find the server that provides the fastest and most consistent results and set it as your preferred server.

Click here to visit Speedtest.net and carry out your tests.

Also read: Open DNS: A big DNS Cache

Windows XP: Speed up Folder Browsing.

Get a faster firefox: FASTERFOX

You can also follow me on Twitter at http://twitter.com/vaibhav1981

Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.

Cheers

Vaibhav

How-To: Improve Swapfile Performance

If you run Windows operating system, this tip can be of use for you. Using this trick, Swapfile performance can be increased considerably leading to a faster PC.

Swapfile2

Most of the programs we run require a lot of memory. In such a scenario, running more than one or two programs can certainly make Windows Operating system suck out all of your RAM. When such a phenomenon happens, Windows starts using space on your Hard Disk called “Swapfile” which certainly is very slow as compared to RAM. This in turn leads to poor performance.

Often Windows starts using Swapfile even before the critical mark. The below mentioned steps can be used to make the Swapfile usage wait till the last moment.

Swapfile

  • Click Start, then Run.
  • Enter msconfig in the space provided to enter command.
  • Click on the tab name System.ini
  • Click on the plus sign (+) next to 386enh.
  • Click New, then type “ConservativeSwapfileUsage=1″ (enter without quotes) in the box that appears.
  • Click OK.

Other Performance related reads:

Microsoft Windows: How to Process Idle Tasks

Windows XP: Speed up Folder Browsing.

The Mystery of Thumbs.db

Use Update Checker to Keep your Softwares UPDATED

Cheers

Vaibhav