question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request content was evicted from inspector cache ??

See original GitHub issue

Hello,

I’m using Puppeteer to do an offline mirror of a site. Problem is, I can’t save large files. The following code is a simplified version of the mirroring bot, and it fails on the .flv (larger) file. My actual target site contains similar flash players and flv files.

const puppeteer = require('puppeteer');
const url = require('url');
const fs = require('fs');
const path = require('path');
const fse = require('fs-extra');

(async () => {
  const savePath = './site';
  const browser = await puppeteer.launch({
    args: [
      '--no-sandbox',
      '--ppapi-flash-version=28.0.0.126',
      '--ppapi-flash-path=/usr/lib/PepperFlash/libpepflashplayer.so',
      '--user-data-dir=/home/howe/.config/chromium'
    ],
    headless: false,
  });
  const page = await browser.newPage();
  page.on('response', async (res) => {
    const parsed = url.parse(res.url);
    try {
      const fn = path.join(savePath, parsed.pathname);
      console.log(`Saving file ${fn}...`);
      await fse.ensureDir(path.dirname(fn));
      await fse.writeFile(fn, await res.buffer());
    }
    catch (e) {
      console.error('Error:', e)
    }
  });
  await page.goto('http://flash.flowplayer.org/demos/plugins/flash/viralvideos-extconfig.html', { waitUntil: 'networkidle2' });
  // browser.close();
})();

After downloading a few smaller files, it throws the following cryptic error:

Protocol error (Network.getResponseBody): Request content was evicted from inspector cache undefined

Any clues? Is this a bug? I have no idea why it works on smaller but not larger files.

Thanks, Howe

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

22reactions
howestevecommented, Jan 5, 2018

Ok, It seems this works (but I didn’t test thoroughly):

await page._client.send('Network.enable', {
      maxResourceBufferSize: 1024 * 1204 * 100,
      maxTotalBufferSize: 1024 * 1204 * 200,
    })

Hope that helps someone else. Thanks @aslushnikov .

5reactions
aslushnikovcommented, Jan 4, 2018

There’s a limitation on the resource content size that devtools keep in memory. It’s 10Mb for resource, and there’s also a total of 100Mb limit to store all resources: InspectorNetworkAgent.cpp

There’s experimental support in the protocol to amend these limits: Network.enable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

failed to load response data request content was evicted from ...
The solution I found for capturing big responses is to copy the request and execute it by other means, such as PowerShell or...
Read more >
failed to load response data request content was evicted from ...
[Solved]-failed to load response data request content was evicted from inspector cache-Reactjs ... If you clean the Cache and Hard Reload I believe...
Read more >
How to Fix Chrome's Failed to Load Response Data Error
If users are requesting file formats like JSON, the error can occur ... load response data request content was evicted from inspector cache...
Read more >
Issue 453078 in chromium: "Failed to load response data"
What went wrong? The contents of the response are not shown: it says "Failed to load response data". The request was done succesfully,...
Read more >
request content was evicted from inspector cache - CSDN博客
3. 点赞 · 踩 · 7. 收藏 · 打赏 · 0. 评论 · request content was evicted from inspector cache.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found