PhantomJS keeping cache

后端 未结 2 1577
伪装坚强ぢ
伪装坚强ぢ 2020-12-31 12:03

I am using phantom js to test accessing a webpage, this runs approximatley 350 times in the space of about half an hour. I am then running webalizer against the server to te

相关标签:
2条回答
  • 2020-12-31 13:02

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

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

    0 讨论(0)
  • 2020-12-31 13:09

    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.

    0 讨论(0)
提交回复
热议问题