If there are too many pieces of noodles, how to improve the speed?

check
there are many videos on my site that need to be added
, but this leads to a slow opening of my network
is there any way to make it faster?
https://www.pexels.com/
has a lot of videos like this
, but he can also finish it in seconds or even faster
. How on earth do you do that?

< hr >

charge

I added the addition
but found that it doesn"t seem to be of any use
maybe the film itself is really too big.
because I never thought that the film files would be so big at the beginning, each of them was 3. Is there any tailoring technology for 4MB
CSS that can be enhanced after tomorrow?
can you just add a certain range?


A simple answer from the point of view of the picture:

  1. lazy loading
    reduce the amount of loading during initialization, and achieve the purpose of loading on demand
  2. http2
    reuse TCP connections, compress the size of HTTP packets, etc., using this method, images can not be placed under multiple domain names.
  3. compress pictures
    Common routines, reduce request size
  4. merge small and commonly used images are sprite or iconfont
    common routines, reduce requests
  5. dns pre-resolution
    has a great influence on dns resolution on mobile.
    I'll put a few connections:
    Wireless performance Optimization: domain name Convergence
    Prefetching, preloading, prebrowsing
  6. reasonably set the image cache mode to enhance reuse and avoid repeated network requests
    mainly http response headers such as if-not-modified/ e-tag
  7. use the test tool to analyze the page loading process
    easy to use lighthouse, has now been incorporated into its devtools by chrome.

clipboard.png

 network  throttle 

-update

you can try progressive pictures

What does the interlaced option in Photoshop do?
When to interlace an image?

Summary:

xD


the main problem of the landlord is that his picture is too big, and the picture of 3jue 4m is not suitable to be displayed directly on the web page, so the solution:

< H2 > compress the picture before uploading < / H2 >
  1. size compression. reduce the size of the image according to the definition requirements, for example, the original image is 4000x3000, is it acceptable to reduce to 2000x1500? Reducing the size of the picture can greatly reduce the size of the picture. The reduction of this size can be realized by using photoshop's automatic batch processing function, or by using some image tool software.
  2. size compression. the front end is generally implemented with tools such as gulp. If it is not a professional front end, it is not bad for jpg to be compressed with photoshop. Usually, it is possible to compress the original film of 3Jing 4m to 300cm 400k according to the parameter of 65. Png can be compressed on https://tinypng.com/ , and multiple files can be packaged and downloaded.
< H2 > list diagram and detailed diagram are separated < / H2 > The

page shows the picture list page, which is a picture of a smaller size, which is sized according to your layout design. After the user clicks on the small image, the user loads and opens the final big image. You can save the picture of the list page on the website you refer to, and the big picture after opening it, and have a look at it. This function of generating small pictures is about to be realized in your php background.

< H2 > Last < / H2 > Finally, there are the optimization methods mentioned upstairs, the most important of which is, of course, lazy loading, or waterfall flow images.


Picture lazy loading + gzip compression

The lazy loading code for this site is the following, which makes a request, returns a piece of js code, and then executes this code to add a new image to the container container.

  

Picture 3-4m, which in itself is a problem

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3712f-2c07a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3712f-2c07a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?