How to make the 1st part of the site loads first? (Like in Google PageSpeed)

前端 未结 14 1543
野性不改
野性不改 2021-01-31 11:01

I have a very large site and it takes pretty long time to load. It takes around 120 seconds. What I\'m trying to do is loads 1st half of the site loads 1st. Then user can surf w

14条回答
  •  再見小時候
    2021-01-31 11:46

    One of the things you can do is to load all the essential (top half) of the page normally, then use javascript/ajax to load the second half of the page. This is a very common technique (and is often used to load images).

    Here is an excellent tutorial from jQuery for Designers, walking through how to use jQuery to load images asynchronously after the page loads. http://jqueryfordesigners.com/image-loading/

    Having said that, a two minute load time seems very excessive. Maybe you should check if there is anything that could be slowing down your server.

提交回复
热议问题