Troubleshooting high bandwidth usage on a marketing site
Based on your concern about bandwidth usage on your marketing site, Sanity has a built-in feature called Request Logs that's perfect for diagnosing exactly what's consuming your bandwidth.
How to Access Request Logs
- Go to your project settings at sanity.io/manage
- Navigate to the Usage section
- Scroll to the bottom where you can download up to 1GB of log data from the last 7 days
- You can request a new export every 24 hours
What You'll See
The logs come as gzipped NDJSON files with detailed information about every request, including:
- Request Type (API, APICDN, or CDN) - helps identify if it's content queries or asset downloads
- Full URL with query parameters
- GROQ Query Identifier - groups similar queries together so you can spot repeated patterns
- Remote IP - identify if traffic is coming from bots or specific sources
- User Agent and Referrer - understand what's making the requests
- Timestamp - spot usage spikes
- Bandwidth usage per request
Analyzing the Data
You can convert the logs to CSV for easier analysis:
gunzip --stdout logfile.ndjson.gz | npx json2csv --ndjson --output output.csvThen open in Excel/Google Sheets, or use tools like jq, GROQ CLI, or even upload samples to ChatGPT for analysis help.
Common Culprits for High Bandwidth
Based on common issues others have found:
- Missing dependencies in useEffect hooks causing infinite request loops
- Bot traffic hitting your site repeatedly
- Inefficient queries fetching too much data
- Large images being delivered without optimization
- CDN not being used when it should be (check if requests show as "API" instead of "APICDN")
Pro tip: Filter out studioRequest entries - those are from your Sanity Studio and don't count toward your bandwidth costs.
The Request Logs should give you a clear picture of what's driving your bandwidth usage so you can optimize accordingly!
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.