Alcove CMS
Ru

Part IV, Delivery

Caching

Seconds on pages, alcoves and pagers, kept in memory.

cache: 60 on a page, an alcove or a pager keeps the rendered result in memory for 60 seconds. The three are independent, so a page without a cache can hold an alcove with one.

A page is cached per address including the query string, an alcove per page and query string, a paginated alcove per page number. Rebuilding the site empties the cache. Static pages are files and ignore it.

An alcove with live: true, or one that reads the visitor, is rendered for each request even inside a static or cached page. The rest of the page is not touched by who is signed in. The sign-in link in the footer is such an alcove.

Below, two alcoves run the same query for the current time in UTC. Only the second has a cache. Reload a few times.

Live result This page is rendered on request.

No cache

19:11:16

Changes on every reload.

cache: 20

19:11:16

Stays for 20 seconds. Reload

Source the files behind the result above

content/alcoves/demo_clock/alcove.yaml

query: SELECT strftime('%H:%M:%S', 'now') AS now

content/alcoves/demo_clock_cached/alcove.yaml

query: SELECT strftime('%H:%M:%S', 'now') AS now
cache: 20