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

前端 未结 14 1545
野性不改
野性不改 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:47

    Prefetching Resources the web page require large files for loading can often benefited from changing the order that those files are requested from the server. Sometimes, it makes sense to download files before they are necessary, so that they are instantly available once requested. When the resources required for a page can be loaded in advance, the user-perceived network latency for that page can be significantly reduced or even eliminated. When you run Google pagespeed insights and see the result, you will see how the fix the problems in your website.

    Some tips to load site faster:

    • Make fewer HTTP requests
    • Add a far-future expires header
    • Gzip your page's components
    • Minify your JavaScript, CSS and HTML

    One more thing when loading a webpage and if you are using php with smarty you can use this plugin which reduces the number of http requests to you server and makes the site load faster by combining all the js and css resource's request into one single HTTP request.

    Alternatively you might be looking for these plugins.

    http://masonry.desandro.com/

    http://isotope.metafizzy.co/

    http://www.wookmark.com/jquery-plugin

提交回复
热议问题