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

[feature] Block loading of resources in Playwright e.g. stylesheets, fonts, media #2229

Open
VonZubinski opened this issue Mar 3, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@VonZubinski
Copy link

Not a duplicate but an extension of #1476

Version and OS
Subscription

Is your feature request related to a problem? Please describe.
Loading unoptimised font files and media on a websites can result in increased data transfers and higher proxy costs due to large file sizes and redundant requests.

Describe the solution you'd like
Playwright's ability to selectively block resources by type.
This would allow for a fine-tuned approach, reducing unnecessary data transfers/carbon footprint and lowering proxy costs.
Simple checkboxes under the Request > Advanced Options menu should be sufficient.

Describe the use-case and give concrete real-world examples
A website we are monitoring, started to detect the Playwright browser and block our watchers.
We are considering to use the proxy services of Brightdata / Oxylabs and are doing cost calculations:

  • Loading all (icon) fonts results in 350kb per monitoring call
  • We are monitoring every 5 minutes, so 60/5*24 = 288 calls per day
  • 288 * 0,000350 GB * 30,5 days * 12 months = 36,893 GB / year
  • Using the Brightdata "micro" plan as an example, this would result in 443 $ per year for one URL
  • We are monitoring 4 URLs of the same domain, this would result in 1770 $ costs just for fonts

We've noticed, that changes are only happing throughout the daytime and will be pausing the watchers with cronjobs & API calls for 10 hours at nighttime.
This will reduce the costs for fonts by 735 $.

The potential cost savings with blocked font resources would be 1035 $ per year.

Additional context
Screenshot 2024-03-03 at 09 28 12

@thecheesypizza
Copy link

This would be super handy as I run into this a whole bunch

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

No branches or pull requests

2 participants