Logo

Speed up your scraping with ad blocking

Blocking adverts loading in your Gaffa scraping requests can reduce page loading time by 50%

May 29, 2026
Speed up your scraping with ad blocking
Every time you load an ad-heavy website, the browser makes dozens of background requests to third-party ad networks, none of which you need when you're scraping content or automating a workflow. These requests slow your page load and add unnecessary overhead to every request. Gaffa's block_ads setting cuts them out entirely.

What does block_ads do?

When block_ads is set to true, Gaffa intercepts and immediately aborts any network request made to a known ad domain before it loads. This includes ad networks and tracking pixels, none of which are relevant when scraping content or automating a workflow. It does not affect the core page content, which loads as normal.
Here’s how to enable it in a request:
Request with block_ads enabled
Note: Ad blocking is currently in beta. If you encounter ad networks that aren’t being blocked, get in touch, and we’ll add them.

How much faster does it make requests?

To quantify the impact, we tested block_ads across three ad-heavy sites — Daily Mail, The Guardian, and Allrecipes under three conditions:
  1. Baseline — block_ads disabled
  2. Block ads — block_ads enabled
  3. Block ads + media — block_ads combined with max_media_bandwidth: 0
The third option combines block_ads with max_media_bandwidth, a setting that blocks downloads of images and videos. If you’re not familiar with it, it’s worth a read before diving into the results.

The Guardian

Baseline
2.03s
Reduction
Block_ads: true
1.50s
Reduction
-26%
Block_ads + max_media_bandwidth
1.29s
Reduction
-36%

Allrecipes

Baseline
2.16s
Reduction
Block_ads: true
1.54s
Reduction
-29%
Block_ads + max_media_bandwidth
1.43s
Reduction
-34%

Daily Mail

Baseline
7.97s
Reduction
block_ads: true
4.27s
Reduction
-46%
Block_ads + max_media_bandwidth
4.22s
Reduction
-47%
The results are consistent across all three sites. block_ads alone reduced running time by between 29% and 47%, depending on the site. The pattern is clear; the more ad-heavy the site, the bigger the gain. Daily Mail, which relies heavily on ad networks and third-party scripts, saw the most dramatic improvement, with page load time dropping by nearly 50%.
The Guardian, which has a comparatively lighter ad load, saw a more modest but still meaningful improvement. This makes block_ads particularly valuable when you're scraping sites that are known for aggressive advertising.

Combining block_ads with max_media_bandwidth

If you want to go further, block_ads pairs with max_media_bandwidth to block image and video downloads in addition to ad requests. As the results above show, combining both settings produced the fastest times across most sites tested.
This is especially useful when you're extracting text content and do not need ads or media. News article scraping, price monitoring, and review mining are all good candidates.
You can read more about max_media_bandwidth and the savings it can deliver in our post on how to slash your Gaffa credits costs by 40%.
block_ads is one of the simplest settings you can enable to get faster requests, particularly on content-heavy, ad-supported sites. Enable it, verify that your target content is still captured correctly, and combine it with max_media_bandwidth to push performance even further. Try it now in the API Playground.

Gaffa Team
Gaffa Team Posts from the Gaffa Team