bautaDocs

Saving Proxy Bandwidth

Block the requests a persona does not need, so it spends fewer of a proxy's bytes.

A persona's "requests" setting spends fewer of a proxy's bytes. The browser blocks in its own network layer, with its HTTP cache on.

Choose a preset

Add "requests" to the persona file, with a preset:

"requests": {"preset": "balanced"}
presetwhat it blocks
safeAudio, video and ad networks' requests.
balancedWhat safe blocks, and third parties' images and fonts.
aggressiveWhat balanced blocks, and every image and font.

Then make the persona from the file, or give an existing one its settings anew:

bauta persona new shop --from shop.json      # a new persona
bauta persona set shop --from shop.json      # an existing one: new settings, its profile kept

From the packages, pass requests:

browser = launch(requests={"preset": "balanced"})
const browser = await launch({ requests: { preset: "balanced" } });

Add your own rules

"rules" adds your own, in Chrome's declarativeNetRequest format: block, allow, and modifyHeaders of request headers.

"requests": {
  "preset": "safe",
  "rules": [
    {"id": 1, "priority": 1, "action": {"type": "block"},
     "condition": {"urlFilter": "||example.com/widgets/", "resourceTypes": ["script"]}},
    {"id": 2, "priority": 2, "action": {"type": "allow"},
     "condition": {"urlFilter": "||example.com/widgets/cart.js", "resourceTypes": ["script"]}},
    {"id": 3, "priority": 1,
     "action": {"type": "modifyHeaders",
                "requestHeaders": [{"header": "X-Example", "operation": "set", "value": "1"}]},
     "condition": {"requestDomains": ["example.com"], "resourceTypes": ["main_frame"]}}
  ]
}

Challenges and CAPTCHAs load in full

Whatever a preset or a rule says, a bot-protection vendor's challenges and CAPTCHAs load in full, as a page must to pass them.

See what a persona fetched

bauta traffic shop

bauta traffic <name> shows what the persona's pages fetched, by kind, what was blocked and what the cache answered.

Next

On this page