Static cache and the Velocity response cache
This page is for website creators who want public pages served as fast as possible. Two features have done this job: the old static cache, which wrote HTML files to disk, and the Velocity response cache, which keeps pages in the server process. Use the second.
Contents
Leave the static cache off
[ContentSettings] StaticCache=disabled is the shipped value and the installer writes it. With the static cache on,
every publish regenerated every affected page on every public siteaccess over HTTP inside the editor's request, so a
publish took seconds (10.12,
Static cache defaults).
The Velocity response cache
It keeps rendered public pages and answers repeat requests inside the server process, before a worker is chosen. It
behaves like a small reverse proxy: conditional requests (304), ETag, Age, stale-while-revalidate, negative
caching, compressed storage, and invalidation by a touched file
(Velocity response cache). It only applies when Velocity serves
the site, and only to anonymous requests.
Turning it on
The cache is off until a setting says enabled: true (since engine release 0.0.4.39). Enable it in a site file or the
cache module of the Velocity configuration (qbixctl enmod cache), with a cache directory, and restart; the feature
page has the exact settings and the order in which configuration files win.
After a change
php bin/php/console exp:velocity cache clear --apply --allow-root-userafter template, stylesheet or setting changes, and after the content cache was cleared. exp:velocity deploy clears
it as its last step. Clearing it does not need a restart.
Checking it
php bin/php/console exp:velocity cache stats --allow-root-user
curl -sI https://www.example.com/ | grep -i -E "age|etag"A second anonymous request for the same page should show an Age header.
Related pages
- Performance and caching for websites
- Deploying with Velocity
- Velocity web server
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.