Edge caching
Public pages are served from the cache, even while the app sleeps.
Built on Caddy
Plans: Every plan, including the free app
What you get
- Repeat requests answered without waking the app
- Controlled by the app's own Cache-Control header
- A separate cached copy for each person
- Cache emptied on every deploy
- Static files kept by browsers for a year
- Nothing to set up
How it works
Every request passes through Caddy, the open-source web server at Whisk's edge. When a page answers with a Cache-Control header and a max-age, the edge keeps a copy and answers repeat requests from it. Copies last as long as the app asks, up to one hour, and a sleeping app stays asleep while they are used.
Copies are kept per person, so nobody sees a page made for someone else, and people who are not signed in never see a signed-in view. Answers that set a cookie, redirects and errors are never cached. A new deploy starts with an empty cache, and previews are not cached at all.
Folders listed under static, such as built scripts and stylesheets, are served from file storage and never wake the app. Browsers keep them for a year, so their file names must change when their content does. Most build tools already do this.
Example
A steel fabricator lists its standard beams, plates and sections on public pages of its website. The pages send a ten-minute cache time, so most visitors browsing the catalogue get the cached copy. The app wakes only when a page has not been opened in the last ten minutes.
For your coding agent
static:
- { dir: dist/assets, path: /assets }Pages that can be a few minutes old send Cache-Control: public, max-age=600, or private for signed-in views. The X-Whisk-Cache response header shows a hit or miss; see the headers reference and public pages.