01Where the bytes go
Open your browser’s developer tools on a typical product page and look at the network tab. The HTML is often a small slice of the total. Images, video, fonts, scripts and tracking calls make up the rest, and a scraper that only reads text needs none of them.
The gateway counts traffic in both directions, so uploads and request headers count too. They are usually tiny next to the responses.
02In headless browsers: block what you do not read
// Playwright
await page.route("**/*", (route) => {
const type = route.request().resourceType();
return ["image", "media", "font", "stylesheet"].includes(type) ? route.abort() : route.continue();
});Blocking stylesheets breaks some pages that need layout to load data; drop stylesheet from the list if that happens. Also block known analytics and ad domains: they are pure overhead.
03Skip the browser where you can
Many sites load their data from a JSON endpoint after the page opens. Find it in the network tab and call it directly: you get the data without the page around it, often at a small fraction of the size.
When you do need HTML, a plain HTTP client fetches one file. A browser fetches dozens.
04Do not download the same thing twice
- Conditional requests. Send
If-None-Matchwith the lastETag, orIf-Modified-Since. An unchanged page answers304with no body. - Compression. Make sure
Accept-Encoding: gzip, bris sent. Most clients do it; some custom ones do not. - Keep raw responses. Store what you fetched. Re-parsing from disk costs nothing; re-fetching costs GB.
- De-duplicate URLs before you fetch. Tracking parameters create many URLs for one page.
05Retry less, retry smarter
A failed request that downloaded a CAPTCHA page still cost traffic. If one network keeps failing on a target, retrying it ten times is the expensive way to find out. Move that target to a network it accepts instead: see residential vs datacenter.