Loading images Faster in Webpage

前端 未结 14 1983
死守一世寂寞
死守一世寂寞 2020-12-30 23:39

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 un

14条回答
  •  说谎
    说谎 (楼主)
    2020-12-30 23:59

    I believe others have given you some good answers on how to optimize the image for downloading. My answer focuses on other aspects which can have a significant effect on web pages.

    Preload the dimensions of your image with php with server.

    ');
    ?>
    

    This will not improve speed, but it will allow browsers to populate rest of page while img downloads. It will look faster. Sometimes perception can be reality.

    In addition, use CSS or Javascript, etc. to Preload your images. I'd use Javascript. There are lots of good sites out there on this. Tops on Google: 3 Ways to Preload Images with CSS, JavaScript, or Ajax

    If you combine both of those and compression, you may have a working solution. But it's hard to say without a working sample. SSR

    I'd also check out: Best Practices for Speeding Up Your Web Site with reference to optimizing content, specifically cache.

提交回复
热议问题