Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(interception): Disable newtork caching when intercepting #1154

Merged
merged 1 commit into from Oct 24, 2017

Conversation

aslushnikov
Copy link
Contributor

Request interception might not work properly if caching is enabled.

Request interception might not work properly if caching is enabled.
Copy link
Contributor

@dgozman dgozman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful change!

@aslushnikov aslushnikov merged commit b9ab6fe into puppeteer:master Oct 24, 2017
@JoelEinbinder
Copy link
Collaborator

JoelEinbinder commented Oct 24, 2017 via email

@Khady
Copy link

Khady commented Oct 25, 2017 via email

@aslushnikov
Copy link
Contributor Author

@Khady unfortunately, that's a limitation of request interception for now.

@Khady
Copy link

Khady commented Oct 25, 2017

@aslushnikov Do you mean it is a limitation of how request interception works in chrome or a limitation in puppeteer?

I'm not sure of what is the original issue. If it is that sometimes a request receives a response from cache and doesn't go through the request interception system, I'm ready to live with this "weird" behavior. I prefer it to the new behavior (which means I loose all my cache IIUC). Because in my case, a response that has been cached will always correspond to a request that would not be blocked or affected by the request interception.

I render a big number of pages using puppeteer and cache saves some network and time. I would be happy with a new parameter to setRequestInterception to turn off the line this._client.send('Network.setCacheDisabled', {cacheDisabled: enabled}), for example. Or to add a new method to decide myself of the value I want for setCacheDisabled. I don't mind setting setCacheDisabled to false myself explicitely, but AFAIK puppeteer doesn't allow me to use the devtools protocol on my side. I can provide a PR if necessary.

@aslushnikov
Copy link
Contributor Author

Do you mean it is a limitation of how request interception works in chrome or a limitation in puppeteer?

@Khady that's a limitation in chrome, interception won't work as it should with caching enabled. This limitation might go away some time in future: there's an on-going refactoring effort in chromium network stack that should help us here.

@emiliavanderwerf
Copy link

Agree with @Khady - I am also prepared to live with the "weird" behavior.

@aslushnikov or anyone else from the Puppeteer team: what is the status please on enabling caching & request interception at the same time?

@Androbin
Copy link
Contributor

Androbin commented May 7, 2021

@Khady @emiliavanderwerf See #6996, #7038, and #7060,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants