What are the differences between html preload and prefetch?

前端 未结 4 585
旧时难觅i
旧时难觅i 2021-02-05 09:40

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

4条回答
  •  失恋的感觉
    2021-02-05 09:51

    rel="preload" loads a resource early for the current document before the body is parsed, potentially saving overall loading time.

    As a hint with a lower priority, rel="prefetch" caches a resource for the next navigation after the current document has been loaded.

提交回复
热议问题