vue開發過程中發現內存一直往上飆,360時不時的提示下清理內存,測試發現每刷新一次頁面內存就增加1%。
清掉瀏覽器的緩存等各種數據以后內存明顯變小,刷新頁面導致內存爆表。
這種問題着實不應該存在,記得在head中有可以清緩存的方式,加上之后果然不會刷新一次加1%的內存了,甚至可以一定程度上緩解vue的內存占用率大的問題,代碼如下:
<meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="content-type" content="no-cache, must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache, must-revalidate" /> <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT"/>
參考:https://blog.csdn.net/xuexiaodong009/article/details/39340637
