Skip to content

Version 5.20

Choose a tag to compare

@andreapollastri andreapollastri released this 29 Nov 09:45
· 8 commits to master since this release
119372a

[5.20.0] — 2026-11-29

The page cache, and WordPress. The links of a campaign are cached as one page instead of one per click; a clear is immediate, however many pages there are; an app can keep its pages in memory; and a WordPress gets an object cache on a Valkey of its own — what the page cache never answers (wp-admin, signed-in visitors, carts) stops asking MariaDB the same things at every request. In the panel (cipi/api 1.50.0, cipi/gui 4.12.0) the app's Cache tab manages all of it, and a Laravel app's own Valkey can be turned on from its page. Asked in #561 and #562.

Fixed

  • Every click on an ad was a MISS (#562). A link with tracking parameters only (/?fbclid=…, /?gclid=…) was cached, but under its whole URI: a different fbclid for every click, so the traffic of a campaign never got a page from the cache and left a copy nobody asked for again. The key of such a link is now the path and a mark of its own, ?cipi-tracking (the map $cipi_cache_key_uri): /?fbclid=AAA and /?fbclid=BBB are one copy.
    • Apart from the page without parameters, never the same copy: what PHP made for an ad click (a lead form that writes the gclid in a hidden field) is not shown to the visitors who came without one. The first click on each page is a MISS, the next ones HITs.
    • The path is taken from $request_uri, never from $uri, which in the location that reaches PHP is /index.php already (try_files): with it every page would have shared one key.
    • A longer list, in one place (CACHE_TRACKING_PARAMS in lib/cache.sh, read by both maps): utm_*, fbclid, gclid, gbraid, wbraid, dclid, msclkid, yclid, twclid, ttclid, li_fat_id, srsltid (Google Merchant Center), epik, igshid, igsh, _kx (Klaviyo), mc_cid, mc_eid, _ga, _gl, mtm_* and pk_* (Matomo), _hsenc, _hsmi, hsa_* (HubSpot), cn-reloaded (Cookie Notice), usqp (AMP), fb_action_ids, fb_action_types, fb_source. Not what a page reads to change itself: ref and aff (affiliate plugins read them on the server and set a cookie), ao_noptimize, age-verified. A link that mixes them with another parameter is not cached, as before.
    • purge /page/ takes the copy of its links along with the page (the purge's key already allowed a query string). Google Analytics, the Meta pixel and WooCommerce's attribution read the parameters in the browser and see them as before; a plugin that reads gclid on the server does not see it on a page from the cache — as for any visitor of a cached page: such a landing page goes in cipi cache <app> exclude.
    • Migration 5.20.0 writes the maps and the vhost of every app whose cache is on again, tested by nginx before the reload (refused: everything back). The pages already cached stay: a page without a query string keeps its key, and the old copies of tracking links, unreachable now, go with nginx's inactive time — an hour at most. Nothing is emptied.

Added

  • cipi cache <app> storage memory|disk — the page cache in memory (#561). A page read often is in RAM already, the kernel keeps it there, so on a fast disk memory gains little; on a slow or shared one (a small VPS, network storage) every MISS is a write that waits next to MariaDB's, and an empty cache costs thousands of deletions. storage memory mounts a tmpfs of the app's own on the same folder: the zone, the purge, cipi-cache-clear and the WordPress plugin do not change.
    • One per app: what one app fills does not stop the others from caching, and the RAM it may take is the size it was given. The tmpfs is the cache's size and a quarter more (32 MB at least) — room for what nginx writes before its cache manager deletes the oldest pages — and the zone gets min_free, so the manager makes room before the tmpfs is full (a full one stops the caching: "No space left on device"). A tmpfs takes only the RAM of what it holds.
    • A systemd mount unit, var-cache-nginx-cipi-<app>.mount: before nginx, mounted again at boot (empty: a cache may be), noexec,nosuid,nodev, 0700 and nginx's user like the folder on disk, LazyUnmount so that it goes even while nginx has files open. Never in /run, the system's tmpfs.
    • The RAM: every cache Cipi keeps in memory — page caches and WordPress object caches together — may take at most a quarter of the server's. A request over it is refused, with the numbers; a server under 2 GB or without swap is said.
    • What was cached on disk is moved aside before the mount (it would stay hidden under it, taking space). storage disk, off and cipi app delete unmount it and remove the unit; a new size remounts it, the pages kept.
    • cipi cache <app> on --storage=memory|disk; storage, in_memory and memory (the tmpfs, the RAM, the share, what the others take) in cipi cache <app> --json; an IN column in cipi cache list. Disk is the default.
  • cipi cache <app> object — the WordPress object cache on Valkey. For a custom app that runs WordPress: object on [--memory=64mb], off, memory <size>, flush, [status] [--json].
    • A Valkey of its own — cipi-valkey@<app>, the instance a Laravel app gets — with a new cache profile: a memory limit, the keys used least recently evicted when it is reached, nothing saved to disk (an object cache is rebuilt, never restored). WordPress's "Flush cache" empties this app's keys and nobody else's.
    • WP_REDIS_* in wp-config.php, the constants of the plugin Redis Object Cache: host, port, password, database, timeouts, between two lines Cipi writes and removes — above That's all, stop editing!, or right above the line that loads wp-settings.php (Bedrock). Then one step in WordPress: install and activate the plugin, Settings → Redis → Enable Object Cache. object says which step is left; ready in the JSON when WordPress uses it.
    • wp-config.php is read and written as the app's user, never as root: written next to the old one under a hidden name nginx never serves (a dotfile, not .php), with its mode, checked with php -l, renamed over it. A symlink is refused; a file php -l refuses is not put in place. A WP_REDIS_HOST (port, password, cluster…) WordPress defines itself is refused with its name — it would win over Cipi's lines.
    • Off: the lines go, then the instance and its memory — on and off give the file back byte for byte. While the plugin's drop-in is still in wp-content, the lines say WP_REDIS_DISABLED instead (the plugin's own switch), so that WordPress does not knock at the server's shared Valkey at every request; off again once the drop-in is gone takes the line away.
    • No password on a command line, in a log, a notification or an answer: it is in wp-config.php and in the instance's configuration (root: 0640). The status says the port, the memory, the keys, hits, misses, evictions and the share of reads found.
    • cipi sync: an app that arrives with its object cache on gets an instance on the new server with the port and the password its wp-config.php names (the file stays as it is) — another port, and the lines follow; none can start, and the lines say WP_REDIS_DISABLED. valkey_sync_keep never writes a .env in a WordPress.
    • A Laravel app is told where its Valkey is (cipi valkey isolate); object off on it touches nothing.
  • The panel's sudoers already allow cipi cache *: storage and object from the panel and the API with no change; neither has a --force to skip a check.

Changed

  • A clear is immediate. cipi cache <app> clear, the clear after a deploy, the panel and cipi-cache-clear no longer delete the pages one by one while the visitors wait: the app's folder is moved aside in one rename — in /var/cache/nginx/cipi, which only root writes — an empty one takes its place, and what was moved is deleted afterwards, as nginx's user, at the lowest CPU and disk priority, in a transient systemd unit of its own (not a child of the PHP-FPM worker that asked: a WordPress plugin's request returns at once). The number of pages is still counted and said. A tmpfs is emptied in place. One sweep at a time; what a reboot left is taken by the next one.
  • cipi help cache and the completion: storage, object.