2 min read
Cache at the edge
Have a small origin route fetch and normalise the catalogue, then set caching headers your CDN honours:
Cache-Control: public, max-age=3600, stale-while-revalidate=86400The CDN serves the cached copy for an hour, then serves slightly stale data while it refreshes in the background — the reader never waits and the API is shielded.
Purge on change
If you need instant updates, purge the CDN key when you detect a catalogue change (via ETag polling). Otherwise the max-age handles freshness.
Frequently asked questions
Which caching header matters?
Cache-Control with max-age and stale-while-revalidate. The CDN serves fast and refreshes behind the scenes, so the origin is rarely hit.
How do I force a refresh?
Purge the cache key when you detect a change. For most integrations the max-age is enough and no manual purge is needed.
Related reading

Quickstart: Cache the product catalogue correctly
The catalogue changes rarely, so caching it removes the API from your hot path and keeps you well under the…
Read →
Quickstart: Cut bandwidth with conditional requests
When the API sends an ETag, a conditional request lets you skip the body entirely if nothing changed — a 304…
Read →
Quickstart: use the Credicorp public API in Cloudflare Workers
Here is the idiomatic way to call the Credicorp public API from Cloudflare Workers. Fetch the product…
Read →
Quickstart: handle rate limits on the public API
The public ring is rate-limited, and a 429 tells you exactly when to try again. Read the RateLimit-Remaining…
Read →Funding for UK limited companies
Credicorp lends to your company, not to you personally — short-term working capital with no personal guarantee. See what your business could access.