Closed marty90 closed 6 years ago
It does not use a clean Chrome profile, in fact it uses whatever you provide since Chrome must be already started in order to run chrome-har-capturer
.
But each URL is loaded in its own browser context:
Similar to an incognito profile but you can have more than one.
Thus both data and DNS (hopefully) caches should be flushed every time.
Thank you for the quick answer. Is there a workaround to prevent this behavior? E.g., simulate a "second visit" of a web page, where most objects are already in the browser cache.
I could add an option to use a single context across all the page loads, what do you think?
It would be great! A lot of performance studies focus on the behavior of caches and cached objects!
It should work, give it a spin.
Cool! Thank You. It appears to work!
Unfortunately the HAR file reports the entry also for objects coming from the cache.
In other words, objects are correctly cached, but the HAR reports them. And it is impossible to distinguish an object coming from the network or from the cache. (I only noticed that the Date
HTTP response header is some minutes before the visit to the page, and, thus, was for sure coming from cache)
However, I think it would be easy to implement as the Response
struct from Chrome has a fromDiskCache
boolean field.
One could add this information in the cache
field of the HAR entry, or create a new _fromDiskCache
.
Yes of course! I thought I added such commit instead I just stashed the change for whatever reason...
It works perfectly :) Thank you !
Ciao!
I've a quick question. If I run multiple times chrome-har-capturer without quitting Chrome between one visit and another, is the cache/profile cleaned? In other words, does each visit use a clean Chrome profile?
Thank You Martino