How sticky sessions on residential proxies work and when to use them
Rotating versus sticky residential sessions, how the session rides in the password, lifetime limits, targeting, and the mistakes that cost people their exit.
Assumed page weights, how to measure yours, what to block in a headless browser, conditional requests, and what 1,000 or 100,000 pages cost at the live price.
Residential bandwidth on GhostConnect costs $2.99 per GB, so what a crawl costs comes down to how many bytes each page pulls through the proxy. That number varies by a factor of a hundred depending on how you fetch, and most people guess it wrong in the expensive direction by rendering pages in a browser when a plain GET would do.
These are the assumptions used in every calculation below. They are round numbers chosen to be plausible for ordinary commercial pages, not measurements of any site, and your targets will differ. Replace them with your own figures from the next section.
| Scenario | Assumed transfer per page | What it is |
|---|---|---|
| API JSON | 20 KB | One JSON response from a site's own API, compressed |
| HTML only | 100 KB | One GET for the document, compressed, no subresources |
| Browser, trimmed | 600 KB | A headless browser with images, media and fonts blocked and third-party scripts refused |
| Browser, full | 2,500 KB | A headless browser loading everything a visitor would |
Two things ride on top of the page itself. Each new connection carries a TLS handshake, a few kilobytes of certificates and keys, so a client that opens a fresh connection per request pays that on every page, while keep-alive spreads it across many. And the bytes you send, request headers and cookies included, count too. Budget for both directions, which is the conservative way to do it, then read what the meter actually said after the first run.
curl reports exactly what a single request moved. The -w option prints variables after the transfer: size_download is the body, size_header the response headers, size_request what you sent.
curl -s -o /dev/null --compressed \
-w 'down=%{size_download} headers=%{size_header} up=%{size_request}\n' \
https://example.com/
Add -x and -U as on the product page and the figures are what the gateway carried. Repeat for a few representative pages rather than the home page alone: product pages, listings and search results tend to differ from each other.
For a full browser load, open the Network panel in your browser's developer tools, tick "Disable cache", reload, and read the summary line at the bottom. "Transferred" is the number that costs you; "resources" is the uncompressed size and is not. The Chrome DevTools documentation explains the panel, and Firefox's network monitor shows the same two figures. Sort by size and you will usually find that three or four assets account for most of the page. In Playwright, the same total comes from summing response.body() lengths in a page.on("response") handler, or from the HAR file that record_har_path writes.
If you must render, because the content arrives by script or you need the page as a visitor sees it, the browser fetches everything the page asks for unless told otherwise. In rough order of savings:
image, media and imageset resource types.font; the page renders in a fallback face and the text is unchanged.In Playwright for Python, a route handler does it:
BLOCK = {"image", "media", "font", "imageset"}
def gate(route):
req = route.request
if req.resource_type in BLOCK:
return route.abort()
if "example.com" not in req.url:
return route.abort()
return route.continue_()
page.route("**/*", gate)
Do not block the document, or the XHR and fetch requests to the site's own API, or the content you want may never arrive. And do not treat blocking as free: a page that loads with no images and no fonts is a measurable oddity to a site that watches for it. The trimmed-browser assumption above, 600 KB, is what is left once the big items are gone and the scripts the page genuinely needs still run.
The cheapest page is one you did not download. Three standard mechanisms help, all described in RFC 9110.
HEAD returns the headers a GET would return, with no body. If you only need to know that a URL exists, its size, its type or when it last changed, curl -I costs a few hundred bytes instead of the page. Not every site answers HEAD honestly, so verify against a GET once.
Conditional GET. Keep the ETag or Last-Modified value from the previous fetch and send it back as If-None-Match or If-Modified-Since. An unchanged page comes back as 304 Not Modified with no body. For monitoring jobs that revisit the same URLs this turns most fetches into headers only:
curl -s -o /dev/null -w '%{http_code} %{size_download}\n' \
-H 'If-None-Match: "33a64df5"' \
https://example.com/product/42
Compression. Send Accept-Encoding: gzip (curl's --compressed does it) and HTML, JSON and scripts shrink by two thirds to four fifths on the wire. Browsers do this by default and so does Python requests, but check whichever client you use, because one that forgets the header pays uncompressed prices for every page.
A requests session that asks for compressed responses and sends conditional requests, using the documentation credentials from the API reference:
import requests
PROXY = "http://rJxYKRe2U:Yxa5WGCUkvP9km@residential.ghostconnect.com:1080"
s = requests.Session()
s.proxies = {"http": PROXY, "https": PROXY}
s.headers["Accept-Encoding"] = "gzip"
etags = {}
def changed(url):
headers = {"If-None-Match": etags[url]} if url in etags else {}
r = s.get(url, headers=headers, timeout=30)
if r.status_code == 304:
return None
if "ETag" in r.headers:
etags[url] = r.headers["ETag"]
return r.text
At $2.99 per GB, with 1 GB taken as 1,000,000 KB and every amount rounded to the cent:
| Scenario | Per page | Pages per GB | 1,000 pages | 100,000 pages |
|---|---|---|---|---|
| API JSON | 20 KB | 50,000 | $0.06 | $5.98 |
| HTML only | 100 KB | 10,000 | $0.30 | $29.90 |
| Browser, trimmed | 600 KB | 1,667 | $1.79 | $179.40 |
| Browser, full | 2,500 KB | 400 | $7.48 | $747.50 |
In the last column, the same 100,000 pages cost $29.90 fetched as documents and $747.50 rendered in full, and the difference is the images and fonts the proxy carried for you. Trimming the browser brings the figure to $179.40, still several times the plain fetch.
Suppose you monitor 5,000 product pages once a day for 30 days; that page count and cadence are the example's assumptions. As HTML-only fetches at 100 KB that is 0.5 GB a day and 15 GB for the month, costing $44.85. As full browser loads at 2,500 KB it is 12.5 GB a day and 375 GB for the month, costing $1,121.25. Add conditional requests and most pages return 304 with no body on most days, so the HTML figure drops further still; how far depends on how often the pages change, which only your target can tell you.
Orders are 1 to 1,000 GB at a time, so even the month of full browser loads fits in one order, and the bandwidth never expires: buy what the arithmetic says plus a margin, and whatever you do not use this month is still there next month. One gigabyte, $2.99, is enough to measure a target properly before committing to more.
Two places show what you actually used, which is the only figure that settles an argument with an estimate. The plan's page on the dashboard shows usage per hour, so a script pulling far more than it should is visible within the hour. The API returns the same series from GET /proxies/residential/{id}/usage, hourly for 24 hours, two-hourly for 7 days or daily for 30, together with the plan's totals:
curl -H "Authorization: Bearer $GT_KEY" \
"https://ghostconnect.com/api/v1/proxies/residential/obcl4126/usage?window=24h"
Divide used_gb by the number of pages your script logged for the same window and you have your real per-page figure. Put that into the bandwidth calculator with your page count and it gives the gigabytes to order at the current price, which is the step most people skip between "it works" and "why is the plan empty".
Metering is the right deal when each byte is worth paying for a household address: the target blocks hosting ranges, or you need a specific city, or you need a session that looks like one person. It is the wrong deal for bulk. A datacenter proxy has unlimited bandwidth for $3.99 per IP per 31 days, which is the price of about 1.3 GB of residential bandwidth; past that point every gigabyte through the datacenter IP is already paid for and every gigabyte through residential is another $2.99. If the target does not care that you come from a hosting range, then downloading files, pulling large API exports or crawling a site you own through residential is paying for nothing; the datacenter versus residential guide goes through that decision at length. An ISP proxy at $5.00 per IP per month is the unmetered equivalent for a static address that looks residential.
Measure first, block what you can, use conditional requests where you revisit, and if the per-page figure still multiplies out to a large number, ask whether the pages need a residential address at all. Which proxy for which job covers the trade-offs product by product, the practical scraping setup puts a bandwidth budget inside a working session design, and HTTP versus SOCKS5 settles the protocol question, which, for the record, does not change the byte count.
Rotating versus sticky residential sessions, how the session rides in the password, lifetime limits, targeting, and the mistakes that cost people their exit.
The usage and proxy detail endpoints, a Python script that polls remaining_gb and tops up below a threshold, how often to poll, and what a top-up costs.
How residential and mobile proxies differ, why mobile costs several times as much, the few jobs that need it, and what to check in a residential provider.