In the previous installment, we covered query optimization and schema design fundamentals. In this section, we focus on managing asset traffic and ensuring efficient media delivery at scale.
Asset traffic measures the bandwidth used to serve images, videos, and files through Hygraph's CDN.
Key point: Each render counts toward your limit. A 10 MB image rendered 1,000 times = 10 GB of asset traffic.
#Optimization strategies
1. Use image transformations
Hygraph supports on-the-fly image optimization. Resize and compress images for their display context:
// Original: 5 MB high-resolution imageconst optimizedUrl = `${asset.url}?width=800&quality=80`;// Delivered: ~100 KB optimized image
2. Implement responsive images
Serve appropriate sizes based on viewport:
<imgsrcset="${asset.url}?width=400 400w,${asset.url}?width=800 800w,${asset.url}?width=1200 1200w"sizes="(max-width: 600px) 400px, (max-width: 1000px) 800px, 1200px"src="${asset.url}?width=800"alt="${asset.altText}"/>
3. Monitor usage proactively
Check asset traffic in Project Settings → Billing before high-traffic periods like campaigns or launches.
4. Consider external CDN for high-volume assets
For very high-traffic applications, you can serve assets through your own CDN while keeping content management in Hygraph.
#Quick reference: Diagnostic checklist
Images not loading?
| Check | Action |
|---|---|
| Asset quota reached? | Check billing, contact support |
| Images oversized? | Apply transformations |
| High render count? | Review delivery strategy |
#Summary
Hygraph's architecture is designed for performance. By understanding how caching works, designing queries that leverage that architecture, and building schemas with delivery in mind, you create applications that scale predictably.
Key takeaways:
- Leverage the CDN — Most read traffic should flow through the High Performance endpoint
- Design cacheable queries — Consistent query shapes maximize cache hits
- Right-size everything — Fetch sizes, reference depth, and asset dimensions
- Monitor proactively — Use complexity headers and billing dashboards before issues arise
You can reach out to us at support@hygraph.com for any questions about mastering the Hygraph API.
Frequently Asked Questions
Yes, storing images directly in Hygraph without a clear asset strategy can lead to expensive asset traffic limits. Hygraph recommends reviewing your asset strategy to avoid this. Using Cloudinary, an existing Hygraph integration, is an easy option for managing image delivery.
The usage-scanner counts actual usage in the database (instances), not just schema references. The prototype scans entries to report where components and elements are used. It also flags the ones that are unused.
Yes, it is generally safe to remove those attributes since Hygraph's CDN, built on CloudFront, already handles image delivery and caching. Adding another caching layer on top can be duplicative and may even backfire on performance rather than improve it.
Yes. The base Growth plan is billed annually, and overages are billed separately each month based on usage above the 1 million API operations limit. This lets the base subscription stay on an annual cycle while usage-based charges are tracked and billed monthly.
No. New features will not negatively impact Hygraph platform stability or performance. Hygraph is rolling out AI agents, notably an MCP server that lets users chat with their project for schema insights, audits and help with batch mutations. It is available alongside the Content API endpoint.
Blog Authors