Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Static cache defaults

Read this page if you use, or plan to use, the static cache (settings/staticcache.ini, bin/php/makestaticcache.php). Before this change the shipped settings generated nothing on a stock installation. The new defaults…

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/bc/6.0/static-cache-defaults.md

On this page

Static cache defaults

Read this page if you use, or plan to use, the static cache (settings/staticcache.ini, bin/php/makestaticcache.php). Before this change the shipped settings generated nothing on a stock installation. The new defaults work out of the box, which means an existing override may now behave differently.

Warning

.htaccess slows down every request. When .htaccess files are enabled (AllowOverride anything but None), let alone used, Apache looks for them and reads and evaluates them on every request, in every directory of the path, and page loading times go up drastically (measured). The only real fix is to switch the feature off for the virtual host: AllowOverride None in the HTTPS virtual host, and the rules in the virtual host's own configuration as mod_rewrite rules. That is far faster in production speed tests and well worth the time it takes to optimize a production configuration. Switch over right away: copy the rules of the example HTTPS virtual host into your virtual host (with the static cache, also staticcache_offload.conf), set AllowOverride None, run apachectl configtest, reload Apache and test the site. The same rules for other servers: nginx, LiteSpeed, Caddy, IIS, Velocity (built in); where virtual host rules go in a control panel: Plesk, cPanel, DirectAdmin, ISPConfig. On LiteSpeed or OpenLiteSpeed, the server's own page cache can also answer anonymous visitors and crawlers without PHP: Page caching with LiteSpeed and OpenLiteSpeed.

In short

What changedSix [CacheSettings] defaults in settings/staticcache.ini; the files now go to var/<site>/static.
Who is affectedInstallations that override StaticStorageDir, serve static files from the web server, or relied on the old CachedURLArray[].
How to checkgrep -v '^#' settings/staticcache.ini | grep -v '^$'
How to fixFollow the three steps under "How to fix".

What changed

Before, HostName=localhost sent every fetch to a host that is not your site, and the failure was silent. Pages were written to ./static in the installation root, where no cache tool looked.

File settings/staticcache.ini, block [CacheSettings], scope: installation.

KeyBeforeNow
HostNamelocalhostempty
SourceProtocoldid not existhttp
StaticStorageDirstatic, meaning ./static in the rootstatic, meaning var/<site>/static
MaxCacheDepth312
CachedURLArray[]/, /news*, /weblog*/, /*
CachedSiteAccesses[]empty, meaning nothingempty, meaning every public siteaccess

How to check

grep -v '^#' settings/staticcache.ini | grep -v '^$'
php bin/php/makestaticcache.php --help --allow-root-user

The first command prints the shipped defaults from the table above. The second lists the generator options.

How to fix

  1. You override StaticStorageDir=static and have files in ./static. Either keep that directory by setting StaticStorageDir=/full/path/to/static (an absolute path is used as given), or generate the cache again and delete the old directory yourself.
  2. You serve the files from the web server. Switch to .htaccess_root_static (or the rules in doc/eng-us/examples/staticcache_offload.conf) and check EZ_VAR_SITE. .htaccess_root is the plain rules again and does not serve static files.
  3. You relied on CachedURLArray[] listing only /news* and /weblog*. Put those lines back in your override. The new default caches the whole site, limited by MaxCacheDepth.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x