How to make the browser (IE and Chrome) request images before scripts?

后端 未结 5 2055
说谎
说谎 2021-02-05 09:36

Note: If you are reading this for the fist time, you may jump directly to the UPDATE, since it addresses the issue more accurately.

So I got a

5条回答
  •  天命终不由人
    2021-02-05 10:17

    Use image preloading capabilities through rel="preload" attribute

    
    

    The as attribute indicates the kind of object the browser should expect. So this adds highest priorities among all images you load on page, but not change priority "JS -> Image"

    
    

    Declaration without as allow to preload images even before js load, increasing Image loading priority.

    Preloading feature

提交回复
热议问题