sitespeedio / chrome-har

Create HAR files from Chrome Debugging Protocol data
MIT License
148 stars 50 forks source link

Cached resources does not appear in har #77

Open F3l1x78 opened 3 years ago

F3l1x78 commented 3 years ago

Hello, I am using chrome-har as a npm package to extract har from my puppeteer scenarios.

However, I can't see the requests served from cache when I reload any page. Here is a quick check-list :

I tested with a simple scenario : a load of https://google.fr as a first step, and then a reload of the page. You can find attached the waterfalls/har of both steps : Google_test_waterfall_cache.zip

For example the google logo is not present in the second capture (https://www.gstatic.com/images/branding/googlelogo/1x/googlelogo_color_92x36dp.png)

Here are some log details that could be useful : chrome-har_cache.zip

Perhaps I misunderstood and chrome-har cannot manage requests served from cache ? The code seems to handle Network.requestServedFromCache, and I'm pretty sure I've already recorded a har which displayed cached ressources !

Don't hesitate if you want a full repro demo with puppeteer.

Thanks a lot, have a good day.

soulgalore commented 2 years ago

Hi @le-chat-du-78 sorry for the late reply. The option object has a field includeResourcesFromDiskCache that if you set it to true will include them.