-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Question] Is there any way to enable http cache when using route ? #7220
Comments
@Syuking Does it hit performance of the page loading in your tests? |
maybe, i just want to try for this |
It would be nice if it was possible to mock responses on some routes while keeping non-matched routes in cache. Use case: replace the content of some files/scripts loaded by a website with local versions, without slowing down the navigation by having to http load everything else everytime. As a workaround I use a MITM proxy but that is not ideal. |
I need this too! |
1 similar comment
I need this too! |
As I detail it in #10414, it's possible to enable/disable http cache with Network.setCacheDisabled from Chrome DevTools Protocol. |
I would like this, too. I want to use page.route() to abort requests to images and other unnecessary resources, but it defeats the purpose if I then lose the ability to cache scripts etc. Is there a technical reason why using route disables the http cache? |
Any update on this? My usecase is also the same i want to mock some files but at the same time check if cache was hit for others on reload. |
also need this |
I really need this feature |
I found
|
is any way to config this without rebuild? |
aabdac8 related to this change? |
Is there any new? |
Would be happy to have this option back as well. |
+1 |
I also need this feature. |
+1 |
I also need this feature. |
+1 |
Workaround // package.json
"scripts": {
+ "prepare": "node prepare.js",
} // prepare.js
import path from 'path'
import {readFileSync, writeFileSync} from 'fs'
const modules = path.resolve(`node_modules`)
const destination = path.join(modules, 'playwright-core', 'lib', 'server', 'chromium', 'crNetworkManager.js')
const buffer = readFileSync(destination)
writeFileSync(destination, buffer.toString().replace('cacheDisabled: true', 'cacheDisabled: false')) |
+1 |
I'm sorely missing the |
Seems that using |
@aslushnikov What kind of feedback do you need for this? |
I also need this feature to make it more efficient, faster! |
Is there a reason why Playwright disables the cache when using |
need this |
+1 |
It definitely seems like something a route should allow when you are using playwright for integration testing. Keeping it alive before a resolver bot gets it. |
It would be great to know why the cache is disabled when using |
+1 |
Chromium will cache js & css files ,but the cache is disabling when using route action
So,Is there any way to enable http cache when using route ?
Cause i hope to reduce the number of requests
The text was updated successfully, but these errors were encountered: