The edge cache is in private preview. Email support@useautumn.com to turn it on for your organization.
Why use the edge cache?
Everycheck and track is a network call from your server to Autumn. For most apps that is fast enough. For hot paths, like gating every AI request, you may want the answer without leaving your own network.
The edge cache is a small service that runs in your own AWS or GCP account. It holds a copy of your customers’ balances, answers check and records track locally. Autumn stays the source of truth and keeps the cache up to date.
How it works
- Your app calls
checkandtrackas usual. The SDK sends them to the edge cache first. - The edge cache answers checks from the balances it holds and deducts tracked usage on the spot. Responses are the same as the Autumn API’s.
- The edge cache sends tracked usage on to Autumn in the background. Whenever something changes in Autumn, like a plan change, Autumn pushes the new state back.
- If the edge cache can’t handle a call, it asks Autumn for you. If the edge cache is down, the SDK asks Autumn directly.
Setting up the edge cache
1
Name it, then pick a region and size
In the dashboard, open Settings → Edge cache. Give the edge cache a name, such as the region your servers run in, then pick an AWS region and a machine size.
2
Choose your network
Use an existing VPC (private to your network), or a new VPC (reachable over the internet with TLS).
3
Create the stack
Click Create stack in AWS. This opens a prefilled CloudFormation page in your AWS account. Create the stack there.
4
Copy the endpoint
Wait for the dashboard to show the edge cache as connected, then copy its endpoint URL from its page.
Sending calls to the edge cache
Pass the edge cache’s endpoint URL to the SDK and turn onuseEdge. Your existing secret key works as is.
useEdge off and call it directly, for example autumn.edge.check().
One endpoint per edge cache
Each edge cache has its own endpoint URL, shown on its page under Settings → Edge cache. Pass a client theedgeURL of the edge cache it should use, usually the one closest to the servers it runs on. Every edge cache in an environment holds all of that environment’s customers, so any of them can answer for any customer.
Each environment can run up to three edge caches. Each one answers from its own copy, so a customer whose calls go to two edge caches at once can briefly be granted more than their balance; the extra lands in Autumn as overage.
What the edge cache handles
The edge cache answerscheck and records track. Tracked usage reaches Autumn in the background. A few calls still go to Autumn, and you get the same response either way:
- Calls that create the customer or entity (
customerDataorentityData). - The first call for a customer the edge cache doesn’t hold yet. It then fetches that customer, so their next calls are handled locally.
attach and every other call go straight to Autumn, as they do today.
How fresh is the edge cache?
Usage tracked through the edge cache is deducted there right away, so the next check is up-to-date. Changes made in Autumn, like a plan change or a balance edit in the dashboard, are pushed to the edge cache as soon as they happen.When the edge cache or Autumn is down
- The edge cache is down or slow: the SDK sends the call to Autumn if the edge cache doesn’t reply within 1 second.
- The edge cache is overloaded: it hands calls to Autumn instead of slowing down.
- Autumn is down: the edge cache keeps answering checks from the last balances Autumn sent it. Anything that must reach Autumn follows the SDK’s fail-open rules.
How long the edge cache keeps data
- A customer whose data hasn’t changed in Autumn for 7 days is removed from the edge cache.
- If the edge cache’s disk gets close to full, the customers whose data changed longest ago are removed first.
- A removed customer’s next call goes to Autumn as usual, and the edge cache fetches them again in the background.