Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading images Faster in Webpage

Tags:

In the web application when i click on a link that should load an image from server, it is taking too much time since the images are sized approxmately 3MB - 5 MB, we are unable to reduce the size because of the image resolution problem.

There is one solution to put height and width, but we are unable to put height and width for the image. How can we resolve it?

I am loading the images from server into div like

<div>   <img src="http://upload.wikimedia.org/wikipedia/commons/1/15/Srtm_ramp2.world.21600x10800.jpg"/>  </div>
like image 810
sasi Avatar asked Oct 17 '14 05:10

sasi


People also ask

What is one way to optimize images for Page Speed?

The most common way to optimize images is to resize them. If you take a photo on a 24-megapixel camera, the image will be 6000x4000 pixels and might be 16 megabytes in size. That's about four times the size of the average website! You can dramatically reduce the file size by resizing the image.


1 Answers

There are a couple of solutions to explore for managing large images:

Try to bring down file size (3-5MB is too high IMHO):

  • Remove all metadata
  • Reduce resolution/pixel-density
  • Reduce height/width of the image
  • Use JPEG compression
  • Use GZIP compression on your server

You can also explore:

  • Use a CDN to serve images (to allow parallel loading)
  • Use services like Cloudinary/IMGIX which allow you to dynamically select the image size you want
like image 91
Sam Avatar answered Nov 04 '22 15:11

Sam