Link to home
Start Free TrialLog in
Avatar of Dinesh Bali
Dinesh Bali

asked on

async image and videos load in website

Hi,

In my we application in php, I have lots of images and videos on the page.
This is making page performance slow.
I wanted that all videos and images should load in async .i.e., the image and video load should not make the page performance slow.

What should I write in image and video tags to make this happen?

Please advise.
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

What should I write in image and video tags to make this happen? 
Nothing, Images already load asynchronously.

When you say page performance slow - can you be more specific?

Are you talking about time it takes for page to fully display?

   

Simple fix...

1) Use HTTP/2 rather than HTTP/1.1 as HTTP/2 is specifically designed to solve this problem, by multiplexing all images over 1x connection.

2) Stick with JPEG images.

3) Compress your images with mozjpeg. If you must use PNG images, compress with pngquant.

4) Videos should never have any effect, as you should stream (not download) all your videos.

5) If you get stumped, provide a clickable URL for testing.
Avatar of Dinesh Bali
Dinesh Bali

ASKER

Many thanks @Julian.
Below are the answers to your questions:

When you say page performance slow - can you be more specific? My site is very old. It takes lots of time to load. It is create in very old CMS. Site is totalbhakti [dot] [com]. Not much control on the code. So, trying to improve the performance of the site.

Are you talking about time it takes for page to fully display? Yes

@David,

Many thanks for your reply. This is very helpful.
Will try and see how this can be implemented in my site.

Regards,

ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial