Forum Moderators: phranque

Message Too Old, No Replies

How to speed of load of over 60 image files in Apache server website?

         

born2run

8:40 am on Apr 24, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi so I have over 75 small logo image files on a page of a LAMP website.

Is there any way I can reduce the number of requests to the server for these logo files each time the page is loaded? One way is CDN is there any other option available that's used widely? Thanks!

lammert

9:00 am on Apr 24, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Switch to HTTP/2. In that case all images will be transferred in one communication pipeline instead of through separate requests.

Another way is to combine the logo image files in one larger file and use sprites to display parts of the image. This is the fastest method and requires only one file and one request. You need to change your HTML code though to make this work.

born2run

9:44 am on Apr 24, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Lammert thanks i think my server supports http2 any settings in Cloudflare? Thanks

lammert

9:59 am on Apr 24, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Cloudflare already uses HTTP/2.

born2run

11:07 am on Apr 24, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ok so other methods?

lammert

11:14 am on Apr 24, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sprites. They beat every other method to serve 75 individual files. The technique is used in arcade games since the seventies of the previous century. Atari was the first to bring the technique to desktop computers. Serve one image file with all the logo's and a high cache time which will keep it in the browser and intermediate caches.

If the logo's are really small, you could serve them as inline image data in the HTML, but that will cost some load time with each load of a HTML file.