PhantomJS keeping cache

三世轮回 提交于 2019-11-30 09:02:52

Run page.clearMemoryCache(); before page.open can clean cache.

It metioned in this issue, and it works fine in PhantomJS 2.0.

There is no way to clear cache (memory or disk). An issue is open on github here since a few months and I still hope this will be released in the future.

This only way is to start a new instance of phantomjs with no disk cache.

PhantomJs is a headless browser, so please consider a PhantomJS instance as an unique user. Does opening 100 times the same web page in your favorite browser will downlaod 100 times every resources of your web page ? No, this is exactly how PhantomJS works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!