Skip to content

Exponential CMS

The static cache

Turn public pages into plain files the web server sends without starting Exponential.

The static cache writes public pages as HTML files, so the web server can send them without starting Exponential at all. It suits sites with mostly public pages that change rarely. It is off by default: site.ini [ContentSettings] StaticCache=disabled, with its own settings in staticcache.ini.

Generate it

In the administration: Setup > Cache, section Static content cache. Pick a site, set the limits and press Create new; each stored page is listed as it is written, and Stop ends the run. Only siteaccesses that can be served to everybody are offered. The view needs the managecache policy of setup/cache.

  • Page limit: 2500 by default, 1 to 20000.
  • Link depth: 12 by default, 0 to 30.

From the command line:

php bin/php/makestaticcache.php --help
php bin/php/makestaticcache.php --site=user
php bin/php/makestaticcache.php --site=user --max-pages=500 --max-depth=6

The generator crawls the site the way a visitor does, starting at the site's root and following only links the site writes, so it visits exactly the addresses a visitor can request. A run replaces what it stored before; --keep adds to it instead. Leave --site out to generate every public siteaccess.

Serve the files

Generating files is half the work; the web server must use them. With Apache and .htaccess, use .htaccess_root_static, which is .htaccess_root plus the offload rules:

./console exp:setup:htaccess --static                 # shows the difference
./console exp:setup:htaccess --static --force --apply # switches; the old file is backed up
./console exp:setup:htaccess --force --apply          # switches back

For a virtual host, add the rules of doc/eng-us/examples/staticcache_offload.conf.

Settings in staticcache.ini

  • StaticStorageDir=static: the files go to var/<site>/static. An absolute path is used as given.
  • CachedURLArray[]: / and /* by default, the whole site, limited by MaxCacheDepth (12).
  • CachedSiteAccesses[]: empty means every public siteaccess.
  • AlwaysUpdateArray[]: / by default, refreshed on every publish.

With the static cache on, a publish refreshes the pages it touches, each once and several at a time; only a successful answer counts.

Note: The static cache only matches siteaccesses by strict host names. For signed-in visitors and for pages that must stay dynamic, see The HTTP cache.

Last updated 11/26/2026. Something missing or wrong? Write to info@se7enx.com.