Block resources
Block resources means the session will not download some heavy page parts. That saves residential traffic.
In the dashboard: Images, Fonts, Media as blocked or allowed. In the API: request field block_resources, response field blocking.
Request field
SessionRequest.block_resources is a string array or null.
Allowed kinds in the OpenAPI description: image, font, media.
| How you send it | What happens |
|---|---|
Omit block_resources | The default set from the plan (plan.block_resources_default on GET /v1/sessions). |
Empty list [] | Download everything. |
| List some kinds | Do not download those kinds. |
Block the usual set
curl -X POST "https://interact.geonode.io/v1/sessions?wait=true" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"country": "us",
"engine": "chromium",
"block_resources": ["image", "font", "media"]
}'Allow everything
{
"country": "us",
"engine": "chromium",
"block_resources": []
}Response field
On SessionRecord, blocking is the list that was honoured, not only what you asked for.
{
"id": "aa11a2a310b4",
"state": "ready",
"blocking": ["image", "font", "media"],
"proxy_bytes": 0
}| Field | Meaning |
|---|---|
blocking | Resource kinds the session refuses to download: image, font, media. |
proxy_bytes | Residential bytes spent so far. Blocking is one way to keep this lower. |
Plan default
PlanBlock.block_resources_default is what runs when create leaves block_resources out.
Next
Was this page helpful?