What are the differences between html preload and prefetch?
问题 Preload and prefetch are both used to request resources in advance so that later resource loading can be quick. It seems that I can interchange the two <link rel="preload" href="foo.js" as="script"> <link rel="prefetch" href="foo.js"> without noticing anything difference. What are their differences? 回答1: Addy Osmani wrote an article that goes into the details of this, but the short version is: preload is a declarative fetch, allowing you to force the browser to make a request for a resource