Caching is how a small number of API requests serves a large audience. The trick is to cache different data for different lengths of time.
| Data | Typical cache | Reason |
|---|---|---|
| Fixtures for later dates | Minutes to hours | Changes rarely |
| Live scores | A few seconds | Changes constantly |
| Finished results | Long, with refresh on correction | Stable once final |
Cache on your server
Fetch once on your server, store the response, and let every visitor read the stored copy. One request now serves thousands of page views.
Use updated-at
Compare the updated-at value with the one you stored. If it has not moved, skip the update. This keeps pages calm and your request count flat.
Show freshness
Display the time of the last update. It turns an unavoidable delay into honest information.
Next step: tell us what you are building and we will point you to the right endpoints.