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

Add page.disableCache(boolean) #1556

Closed
ebidel opened this issue Dec 8, 2017 · 6 comments

Comments

Projects
None yet
5 participants
@ebidel
Copy link
Contributor

commented Dec 8, 2017

Related to #1551, it would be useful to have an API call to disable the browser's disk cache.

Use cases:

  • A/B test server caching/config without having to relaunch chrome or use userDataDir to do multiple runs.
  • Use a single browser instance to test the first load of every view of a SPA. Need to bypass the cache to ensure requests are always fresh for shared resources.

Ref: Network.setCacheDisabled

@aslushnikov

This comment has been minimized.

Copy link
Collaborator

commented Dec 11, 2017

Nice usecases, thanks

This should be easy to implement, similarly to the setJavascriptEnabled:

puppeteer/lib/Page.js

Lines 564 to 566 in a164524

async setJavaScriptEnabled(enabled) {
await this._client.send('Emulation.setScriptExecutionDisabled', { value: !enabled });
}

@vonGameTheory

This comment has been minimized.

Copy link

commented Dec 11, 2017

Yes please. Is there any approved way of disabling it currently? The only thing I could come up with was using these at launch:

--media-cache-size=1
--disk-cache-size=1

(On linux it was suggested to set the cache directory to /dev/null, but on Windows?)

@ppatel221

This comment has been minimized.

Copy link

commented Dec 12, 2017

Hey, im part of an Open Source Development class at Seneca College and im looking to contribute to an open source project. Can i help with this feature?

@ebidel

This comment has been minimized.

Copy link
Contributor Author

commented Dec 12, 2017

@ppatel221 feel free. We're not going to turn down a PR :)

@MountainDrew

This comment has been minimized.

Copy link
Contributor

commented Dec 15, 2017

I have added this in my open PR ^ (#1609). Although it does depend on your changed in #1601, @ebidel

@MountainDrew

This comment has been minimized.

Copy link
Contributor

commented Feb 7, 2018

Would be great to get a review on this and with new methods implemented #1609, thanks!

aslushnikov added a commit that referenced this issue Feb 8, 2018

feat(Page): add `setCacheEnabled(enabled)` to Page object (#1609)
This change adds in the `Page.setCacheEnabled(enabled)` method to toggle ignoring cache for each request.

Fixes #1556.

brigand added a commit to brigand/puppeteer that referenced this issue Feb 9, 2018

feat(Page): add `setCacheEnabled(enabled)` to Page object (GoogleChro…
…me#1609)

This change adds in the `Page.setCacheEnabled(enabled)` method to toggle ignoring cache for each request.

Fixes GoogleChrome#1556.

MercifulCode added a commit to MercifulCode/puppeteer that referenced this issue Feb 9, 2018

docs: Spelling and Markdown Consistency
- Adding missing language tags to markdown code blocks.
- Switching `npm` to `yarn` in README to be consistent with what repo is using locally/with travis.

Removed unneeded  and  for yarn command per code review

Also removing  from travis and appveyor yarn invocations

Fixed merge conflicts and yarn references

Removed yarn.lock and added language to code fence

Cheeky capital letter

Touched up numbering (and also switched git email account due to CLA mis-match)

feat(Page): add `setCacheEnabled(enabled)` to Page object (GoogleChrome#1609)

This change adds in the `Page.setCacheEnabled(enabled)` method to toggle ignoring cache for each request.

Fixes GoogleChrome#1556.

docs(CONTRIBUTING): update contributing.md (GoogleChrome#1973)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.