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

Performance and caching for websites

Make a site fast - the cache layers from browser to database, the levers in order of effect, measuring with exp:benchmark, and the rule for clearing caches in the right order.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/creators/website-creators/performance-and-caching.md

On this page

Performance and caching for websites

This page is for website creators who want fast pages. Exponential caches at many levels; most of them are on by default. This page shows the layers, the levers in order of effect, and how to measure (10.12 Performance tuning).

Preload Sites: warm the caches of the sites after a clear
Preload Sites: warm the caches of the sites after a clear

Contents

  1. The layers
  2. The levers, in order of effect
  3. Measure
  4. Templates that stay fast
  5. Clearing caches in the right order

The layers

LayerWhat it keepsRead
Browser, proxy, CDNpages and static files, when headers allowHTTP caching, proxies and CDNs
Velocity response cachewhole public pages, answered without PHPStatic cache and the Velocity response cache
Content view cachethe rendered main area of each pageView cache and cache blocks
Template block cache{cache-block} output: menus, footerssame
Compiled templates.tpl compiled to PHP
OPcachecompiled PHP10.12
SQL query cachequery results, optionalSQL query cache

The levers, in order of effect

From the installation book:

  1. Serve with Velocity and its response cache; persistent workers keep the application warm.
  2. Keep the content view cache and the template block cache on ([ContentSettings] ViewCaching=enabled, [TemplateSettings] TemplateCache=enabled, both shipped). Warm the site after a full clear with php bin/php/warm.php --allow-root-user.
  3. OPcache.
  4. APCu for the response cache's memory tier and the shared query cache.
  5. The SQL query cache (querycache.ini), measured on your site.
  6. The database itself (Databases).

Leave the static cache off (StaticCache=disabled, the shipped value); the response cache gives visitors the same benefit without slowing down publishing.

Measure

php bin/php/console exp:benchmark --save=var/benchmark/base.json --allow-root-user
# change something
php bin/php/console exp:benchmark --baseline=var/benchmark/base.json --threshold=15 --allow-root-user

It prints median, p90 and p99 per page. Compare runs on the same machine, back to back (Benchmarking). Measure also in the browser: image sizes, number of requests and layout shifts often matter more than server time.

Templates that stay fast

  • Fetch only what you show: limit, class_filter_array, load_data_map where offered.
  • No fetch of a whole subtree in the pagelayout without a cache block.
  • Cache blocks keyed by exactly what the output depends on.
  • Images in the right alias size, with width, height and loading="lazy" (Images and image variations).
  • Stylesheets and scripts through the packer (Stylesheets and scripts).

Clearing caches in the right order

A page rendered by old code between a cache clear and a PHP reload is cached again. So: INI and template caches, then reload PHP and restart Velocity, and only then the content, template-block and response caches. Under Velocity exp:velocity deploy does this in order (The order after a code change).

You changedClear
a setting--clear-tag=ini
a template--clear-tag=template
a new template or override rule--clear-id=template-override,design_base
a stylesheet or script--clear-id=ezjscore-packer,template-block, then the Velocity cache
content looks stale--clear-tag=content

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.

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