Software Development1 min read

A data flow that does not exhaust an external API quota

Calling an external service for every visitor is slow and expensive. How a simple cache layout protects your quota.

When a website reads from an external API, the first idea is to call it for every visitor. As traffic grows the quota runs out and the site goes empty.

Move the request to the server

Do not let the browser call the external API directly. A server function in between also protects your key.

Cache by rate of change

Caching slow-changing data such as a video list for half an hour and fast-changing data such as live status for ninety seconds can keep use well under the quota.

Find the expensive calls

Some API endpoints cost far more quota than others. There is often a cheaper endpoint for the same information, so check unit costs in the documentation first.

FluxPeek MühendislikEngineering team

Our articles come from issues we meet in our own projects.

Related articles