Bookmark Topic Watch Topic
  • New Topic

image tag in html

 
Naresh Chaurasia
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
I am going through HFSJ,chapter 1 which says that when ever the browser is rendering the html page and it comes across the image tag , it generates another HTTP request to get the resource descirbed.
I wanted to know why a new HTTP request has to be sent to server for each image tag.

java pro
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
"java pro",
it appears that you have changed your display name from one that is valid to an invalid one.

We require display names to be two wors: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct our display name, since accounts with invalid display names get deleted.

thanks,
Dave.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
A HTTP request is able to send one resource. When you request a web page, you get sent the web page. Extra 'bits' like images, fonts, favourite icons, sounds and animations are 'new' resources and they must be loaded separately with new HTTP requests.

A new HTTP request does not always require a new HTTP connection though. As a performance improvement in HTTP1.1, it supports a 'Keep-Alive' connection so that multiple requests can be sent down one connection without needing to keep establishing new connections.

Dave
 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

As David Allready told you HTTP cannot get extra bits of images and other such things in one hit, So it has to make an extra call. Also as HTTP is a stateless protocol so for every resource it has to make a seperate call to the server.

Cheers,
Rahul
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Well, normally I would move this to the HTML forum since it is not a question about Servlets. But since there are already good responses here, I am just going to close this thread.

Thanks

Mark
 
    Bookmark Topic Watch Topic
  • New Topic