I have image and txt file of same size say 200 KB. Now i would like to calculate the time to download the image and text of text file.
Now my question is adding image to DOM and and then calculating time on onload and requesting content of txt file using Ajax will they take same time or due to image and xml they will take different time ? why ?
Hi i have run a small experiment on the local machine and results are surprising. Experiment environment
- add 8MB image to DOM and calculate time for its download i tried this for 20 times making sure that the image is not getting cached. I found that on local machine it takes around 4 seconds.
- 8 MB text file is requested using the AJAX and i found that it takes around 20 sec to download the textual contents
The think is clear from the experiment but question is still there why ? can any one help on this.