Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does <img src=""> hurt performance?

Tags:

html

asp.net

I just wanted to know if <img src=""> hurts performance in asp.net? If yes, then how, and what is a better solution?

EDIT

I would like to add some more details:-If developer miss the src tag or if the image is missing from the server(for example a.jpg is missing from the server)

<img src="Images/a.jpg">

EDIT

I asked this question because recently I faced a problem in which our Page do double postaback just because of fav.ico was missing from the server.

like image 373
santosh singh Avatar asked May 12 '11 16:05

santosh singh


People also ask

How are images affect the performance of a website?

Sites that use too many images, or have images that are too large, have longer loading times. This can slow down your entire page, irritating visitors and actually hurting your site's ranking in online search results.

What is SRC in image processing?

SRC (Source) The SRC attribute specifies the URI for the image to be embedded. Its syntax is the same as that of the HREF attribute of the <A> tag.

When should I use next image?

next/image changes the image to WebP format when you request. WebP format reduces the size of the image while keeping the quality. It also makes lazy loading which is great if the user doesn't see your entire page.

What is lazy loading example?

For example, if a web page has an image that the user has to scroll down to see, you can display a placeholder and lazy load the full image only when the user arrives to its location.


1 Answers

Yes, as you need another request to get the image. ;-)

IE6 won't respect content expiration headers when <img> is inside iframe.

It may be better to use a background image (CSS) with a sprite.

like image 158
Jakub Konecki Avatar answered Oct 23 '22 02:10

Jakub Konecki