Why location.reload() is slower than the other page reload methods?

前端 未结 2 2030
时光取名叫无心
时光取名叫无心 2021-02-20 10:41

Few months ago I posted this answer about how to refresh the page via JavaScript.

I provided a JSFIDDLE DEMO too:

var solutions = [
    function () { loc         


        
2条回答
  •  说谎
    说谎 (楼主)
    2021-02-20 11:20

    From the Mozilla Developement Network I guess the .reload method may fetch all files from the Server again. This would be similar to a CTRL + F5 reload.

    The location.href for example, simply follows the link which may be cached. As for the MDN definition the behave is not clearly defined so I guess its browser and case specific behave.

提交回复
热议问题