Skip to content
proxiessticky sessionsproxy rotation

Rotating vs Sticky Proxies: When to Use Each

Sticky vs rotating proxies: a new address on each request, or the same address for 10, 30, 60, or 120 minutes. When to use each on ProxyLabs.

Sticky vs rotating proxies is a choice of address lifetime. Rotating proxies assign a new IP address on every request. Sticky proxies keep the same IP for a defined period. On ProxyLabs residential proxies that period is 10, 30, 60 or 120 minutes. Picking the wrong type doesn't just reduce efficiency — it can actively cause failures. A multi-step checkout flow with rotating IPs will break because the server sees different IPs mid-session. A bulk scraping job with sticky IPs will get flagged because 500 requests from one IP in 10 minutes is abnormal residential behavior.

Here's the decision framework based on real usage patterns.

Quick Decision Table

Use caseProxy typeWhy
Scraping product pages (independent URLs)RotatingEach request is standalone, max IP diversity
Scraping search results (pagination)RotatingPages are independent, no session state
Login → navigate → scrapeStickyServer tracks session by IP
Multi-step checkout flowStickyIP change mid-checkout = instant flag
Account creationStickyRegistration flow spans multiple requests
Social media account managementStickyPlatform ties session to IP
Price comparison across regionsRotating + geoDifferent IP per region, no session needed
SERP monitoringRotating + geoIndependent queries, max diversity
Ad verificationRotating + geoNeed many IPs to see different ad variants
Sneaker/ticket purchasingStickyCart → checkout is stateful

How Rotating Proxies Work

With a gateway proxy, rotation happens automatically. Each new TCP connection through the gateway gets assigned a different exit IP from the pool.

python
import requests

# Each request gets a new IP — no session ID in the username
proxy = {
    'http': 'http://your-username:[email protected]:8080',
    'https': 'http://your-username:[email protected]:8080',
}

for i in range(5):
    r = requests.get('https://httpbin.org/ip', proxies=proxy)
    print(f"Request {i+1}: {r.json()['origin']}")
    # Each new connection can exit on a different address.

When Rotating Proxies Excel

Bulk data collection: Scraping product pages where each URL is an independent request. A new connection can leave from a different address, so one blocked address affects that request.

Search engine scraping: Each search query is standalone. A rotating residential request can take a different address each time, which keeps a single address from carrying the whole job.

Data verification: Checking prices, stock levels, or content from many different IPs to verify you're seeing the same data that real users see (some sites serve different content to repeated visitors).

Rotating Proxy Pitfalls

Session-dependent pages: If the site sets a cookie on request 1 and expects the same IP on request 2, rotation breaks the flow. This includes most login-protected content, shopping carts, and multi-page forms.

Rate-limited APIs: Some APIs rate-limit per IP per minute. With rotating IPs, you might hit the same exit IP twice by chance and trigger a limit. For APIs, sticky sessions with a dedicated IP per worker thread is more predictable.

How Sticky Proxies Work

Sticky sessions maintain the same exit IP for a time window. With ProxyLabs, that window is 10, 30, 60 or 120 minutes. The dashboard writes the length in seconds as -ttl-, then the id as -session-. The order is country, region, city, -ttl-, -session-. -ttl- is a lifetime from the start of that session. Reusing the session id inside the window keeps the address. It does not start the clock again. A new session id is how you ask for another address. Copy the finished string from the dashboard. Europe, Asia, and worldwide use eu.proxylabs.app:8080. The Americas use us.proxylabs.app:8080.

python
import requests

# Same session ID = same IP for the ttl you set (10, 30, 60 or 120 minutes)
proxy = {
    'http': 'http://your-username-ttl-3600-session-abc123:[email protected]:8080',
    'https': 'http://your-username-ttl-3600-session-abc123:[email protected]:8080',
}

for i in range(5):
    r = requests.get('https://httpbin.org/ip', proxies=proxy)
    print(f"Request {i+1}: {r.json()['origin']}")
    # Output: same IP all 5 times

When Sticky Proxies Excel

Login flows: The server ties your session cookie to your IP. If the IP changes between the login POST and the next authenticated request, the session is invalidated. Most sites with user accounts do this.

python
import requests
import uuid

session = requests.Session()
session_id = uuid.uuid4().hex[:12]

proxy = {
    'http': f'http://your-username-ttl-3600-session-{session_id}:[email protected]:8080',
    'https': f'http://your-username-ttl-3600-session-{session_id}:[email protected]:8080',
}

# Login
session.post('https://example.com/login',
    data={'email': '[email protected]', 'password': 'pass'},
    proxies=proxy
)

# Subsequent requests use the same IP — session cookie stays valid
dashboard = session.get('https://example.com/dashboard', proxies=proxy)
settings = session.get('https://example.com/settings', proxies=proxy)

Account management: Managing multiple social media accounts requires each account to have a consistent IP. If account A always connects from IP 1 and account B always connects from IP 2, they look like separate users. If both cycle through random IPs, the platform may link them.

E-commerce checkout: Cart → shipping → payment → confirmation is a multi-step flow where the server expects IP consistency. Mid-flow IP changes trigger fraud detection on most e-commerce platforms.

For a detailed guide on sticky session patterns, see our sticky sessions guide.

Sticky Proxy Pitfalls

Long scraping jobs: A sticky session sends every request in that window out of one address. A target that limits how much one address can fetch will apply that limit to the whole window. Use a new session id per batch when the pages do not need to share an address.

The window ends: The address is held for the TTL you set, measured from the start. When you need another address, generate a new session id. When you need the same address tomorrow, use a dedicated ISP proxy. A sticky session does not cover that.

Hybrid Approach: Rotating + Sticky

Most real scraping jobs need both. The pattern: use rotating IPs for the bulk scraping work, switch to sticky for any stateful flows.

python
import requests
import uuid

PROXY_BASE_USER = 'your-username'
PROXY_PASS = 'your-password'
TTL_SECONDS = {10: 600, 30: 1800, 60: 3600, 120: 7200}


def gateway(country):
    """us, ca, mx, br, ar, co, cl, pe use us.proxylabs.app. UK is gb, on eu."""
    code = (country or '').lower()
    if code == 'uk':
        code = 'gb'
    if code in {'us', 'ca', 'mx', 'br', 'ar', 'co', 'cl', 'pe'}:
        return 'us.proxylabs.app:8080'
    return 'eu.proxylabs.app:8080'


def country_code(country):
    code = country.lower()
    return 'gb' if code == 'uk' else code


def rotating_proxy(country=None):
    """New connection, no session id, so the gateway can assign a new address."""
    user = PROXY_BASE_USER
    if country:
        user += f'-country-{country_code(country)}'
    host = gateway(country)
    return {
        'http': f'http://{user}:{PROXY_PASS}@{host}',
        'https': f'http://{user}:{PROXY_PASS}@{host}',
    }


def sticky_proxy(session_id=None, country=None, minutes=60):
    """Same session id keeps one address for the ttl, measured from the start."""
    user = PROXY_BASE_USER
    if country:
        user += f'-country-{country_code(country)}'
    if not session_id:
        session_id = uuid.uuid4().hex[:12]
    user += f'-ttl-{TTL_SECONDS[minutes]}-session-{session_id}'
    host = gateway(country)
    return {
        'http': f'http://{user}:{PROXY_PASS}@{host}',
        'https': f'http://{user}:{PROXY_PASS}@{host}',
    }


# Phase 1: Rotating IPs to collect product URLs
product_urls = []
for page in range(1, 20):
    r = requests.get(
        f'https://example.com/products?page={page}',
        proxies=rotating_proxy('us'),
        timeout=15,
    )
    # Parse product URLs from response...
    product_urls.extend(parse_urls(r.text))

# Phase 2: Sticky IP per product for detail + price + reviews
for url in product_urls:
    sid = uuid.uuid4().hex[:8]
    proxy = sticky_proxy(session_id=sid, country='us', minutes=60)
    session = requests.Session()

    detail = session.get(url, proxies=proxy, timeout=15)
    reviews = session.get(url + '/reviews', proxies=proxy, timeout=15)
    # Same IP for both requests — looks like a real user browsing

Bandwidth Considerations

Sticky and rotating sessions use the same bandwidth. The cost difference comes from efficiency:

ScenarioRotatingStickyWhy
1,000 independent pages1× bandwidth1× bandwidthSame data either way
Login + 50 pages (session needed)The login runs again after each new address1× bandwidthRotating breaks the login, so the flow starts again
100 URLs, strict rate limit (5/min/IP)1× bandwidth1× bandwidthBut sticky requires 20 IPs at 5 req each

With ProxyLabs, bandwidth is priced the same regardless of session type. It lists at £2.50/GB, is £1.00/GB from 5,000 GB, and is £0.95/GB from 10,000 GB. The economic decision is about minimizing wasted bandwidth from failed requests, not about session pricing.

How to Set Sessions in Different Tools

ToolRotatingSticky
requests (Python)No session modifierCountry, then -ttl-, then -session-, on the username
ScrapyNo session modifierSame username order on the proxy URL
PlaywrightNo session modifierSame username order. See the Playwright guide
PuppeteerNo session modifierSame username passed to page.authenticate()
cURLNo session modifierSame username in the proxy URL
AxiosNo session modifierSame username. See the Axios guide

For tool-specific setup, see our integration guides: Playwright, Selenium, Puppeteer, Scrapy, or cURL.

Useful guide? Share it with your team.

Share
← Back to all articlesBack to top ↑
All articles ↗
scrapy

Scrapy Proxy Middleware: Rotating IPs Without Bans

Build a Scrapy proxy middleware that rotates residential IPs per request. Includes retry logic, geo-targeting, bandwidth tracking, and ban detection.

6 min read
python

Web Scraping with Python Requests and Proxies: Complete Guide

How to configure proxies in Python's requests library, handle authentication, rotate IPs, manage sessions, and avoid the most common mistakes that get you blocked.

8 min read
residential proxies

Why your residential proxy still gets blocked on Akamai and Cloudflare sites

A residential exit can be clean and still meet a block page. The address, the TLS handshake, and the challenge script are three separate checks.

6 min read