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 test page accesses.
My phantom js clients are inside 1 instance of phantom js so it basically works in the sense that once one client has opened the web page kick off the next client, all with individual IP addresses and MAC addresses throughout.
However what I am finding in webalizer is that while I get 350 hits to the server I am only getting 1 hit per instance of phantomjs I run on some css files and others. So I have come up with the idea of it caching clients together.
I have attempted running --max-disk-cache-size=0 when calling the phantom js instance but still see it acting the same.
Has anyone experienced the same before?
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 test page accesses.
My phantom js clients are inside 1 instance of phantom js so it basically works in the sense that once one client has opened the web page kick off the next client, all with individual IP addresses and MAC addresses throughout.
However what I am finding in webalizer is that while I get 350 hits to the server I am only getting 1 hit per instance of phantomjs I run on some css files and others. So I have come up with the idea of it caching clients together.
I have attempted running --max-disk-cache-size=0 when calling the phantom js instance but still see it acting the same.
Has anyone experienced the same before?
Share Improve this question asked Apr 30, 2014 at 14:34 CharabonCharabon 7873 gold badges11 silver badges24 bronze badges2 Answers
Reset to default 18Run 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.