Overview
Caching stores your upstream's responses on our proxies and serves repeat requests straight from there. Your custom domains load faster and your servers handle fewer requests.
Enabling the Caching add-on
Log in to your SaaS Custom Domains account.
Click CDN in the sidebar, then click Enable Caching. You can also go to Settings → Billing and enable Caching under Add-ons.
Check the confirmation window and click Enable.
Settings → Billing
Note: Enabling the add-on doesn't cache anything by itself. Turn caching on in the account defaults or for specific domains, as described below.
Account defaults
On the CDN page, under Account defaults:
Enable HTTP caching turns caching on for every domain that doesn't have its own setting.
Default cache TTL is how long a response is kept, in seconds. The minimum is 60 and the default is 300 (5 minutes).
Cache mode decides how closely we follow cache headers.
Cache modes
Strict (default): follows standard HTTP caching rules (RFC 7234). Your upstream's
Cache-Controlheaders decide what is cached and for how long.Bypass: caches responses and ignores all cache headers, from your upstream and from the visitor.
Bypass request: ignores the visitor's cache headers but follows your upstream's.
Bypass response: follows the visitor's cache headers but ignores your upstream's.
Careful with Bypass and Bypass response. They can cache pages that are different for each visitor, like logged-in pages or responses that set cookies, and show them to other visitors. Use them only on domains that show the same content to everyone.
Per-domain settings
Open a custom domain and go to its Caching tab. You can also click a domain in the Domain-specific overrides list on the CDN page. Choose one of:
Use Account Defaults: the domain follows your account defaults.
Disable Caching: nothing on this domain is cached.
Override Settings: set this domain's own TTL and cache mode.
Purging the cache
To clear everything cached for a domain, open the domain's Caching tab and click Purge Entire Cache under Manual Cache Purge. It takes a few seconds to clear in all our regions.
You can also purge from your own app with the Purge HTTP cache API endpoint, for example right after one of your users publishes changes.
What to cache
Good fits: public pages that look the same for every visitor, and static files like images, CSS, JavaScript and fonts.
Don't cache: logged-in pages, dashboards, checkout, and API responses that depend on who is asking. Have your app send
Cache-Control: privateorno-storefor these and keep the mode on Strict, or disable caching for that domain.
Cached responses are stored separately for each custom domain, so a page cached on one of your users' domains isn't served on another's.
Turning caching off
To stop caching on one domain, choose Disable Caching on its Caching tab.
To stop paying for the add-on, go to Settings → Billing and click Disable next to Caching. It stays on until your next payment, which includes that month's charge, and then turns off. Your settings are kept in case you turn it back on.
Until next time, keep building!
Need more help? Reach out via the Intercom chat widget and we'll be right with you!



