Skip to content

feat(cache): record cache, page cache and cache tools for public pages - #35

Merged
xiregroup merged 10 commits into
mainfrom
feat/cache
Nov 18, 2026
Merged

xiregroup merged 10 commits into
mainfrom
feat/cache

Conversation

@xiregroup

Copy link
Copy Markdown
Contributor
  • feat(cache): record cache, page cache and cache tools for public pages
  • build(admin): rebuild the bundle with the cache screen
  • fix(cache): drop kept sites, languages and paths on flush, drop again after commit
  • test(cache): every changed line of the admin cache tested both ways
  • test(cache): cached pages, questions, reviews and imports tested both ways
  • fix(cache): boot writes nothing to the cache, tests run on MySQL and PostgreSQL
  • test(cache): settings, debug line and card language tests hold on MySQL and PostgreSQL

@xiregroup
xiregroup enabled auto-merge November 17, 2026 23:54
@xiregroup
xiregroup added this pull request to the merge queue Nov 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Nov 18, 2026
@xiregroup
xiregroup added this pull request to the merge queue Nov 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 18, 2026
Lists ask the database only for IDs; each record comes from a per-record
card, read for a whole page in one multi-get. Cards are plain arrays built
from the admin fields (every language, link-field relations, SEO, pictures,
the public URL, what extenders add) and are dropped on save, delete and
restore, with version counters for related lists and cards. bulk() drops
once after an import. Works on every Laravel store: tags on Redis and
Memcached, version keys on the file and database stores.

Catalog, news, pages, brands, stores, FAQ and reviews read their public
lists through it, the theme keeps its record view in the card, and module
settings are kept in it, so a warm list or product page runs no query.

An optional page cache for visitors without a login (off by default)
swaps the CSRF token on the way out, sends ETag, Last-Modified and
Cache-Control for a CDN, and never keeps a page holding something made for
one visitor, such as the image captcha's question.

atrium:cache:warm, an admin screen with hit rate, size and clear, a debug
line in local mode, the atrium.cache.stats filter for monitoring, a
benchmark of 10 000 products with 40 properties on MySQL and PostgreSQL,
and docs/cache.md in English and Russian.
… after commit

A save inside a transaction drops the record's cards a second time once
committed, so a visitor who read between the save and the commit does not
keep the old row. Sites::flush(), ContentLanguages::flush() and
PublicUrl::forgetPaths() now drop what the record cache keeps too;
switching the current site only forgets the picked languages. Cards
hydrate their model on the default connection name, so is() holds.
Pages::preloadLinks() reads the fields of any model that declares them.
Adds the Dusk test of the cache screen.
Tests for the record cache, its versions, cards and card builder, the
cache store, the page cache, the debug line, the cache screen and the
warm command, down to the last mutant. Redundant casts and wrappers that
no test could tell apart are gone from the cache classes.

CacheStore::size() looked up the database store as
cache.stores..table when atrium.cache.store was not set; it now falls
back to the default store.
… ways

The theme draws cached cards the same way it draws records, the FAQ list
follows its categories, reviews and page trees come from the cache, and
every Bitrix import drops the whole cache at the end even when it brought
nothing. Linked records in the theme are kept by class, column and value.
…PostgreSQL

Wiring a module in at boot called PublicUrl::forgetPaths(), which now
bumps a version in the cache store: on a fresh install with the database
store, artisan and migrate died before the cache table existed, and every
request wrote to the cache. Wiring, page saves and the theme's save
listener forget only the paths of the request (PublicUrl::forgetMemo());
a saved section drops the kept tree by itself.

The debug line lets clicks through to the page under it. The cache
fixture tables live in a test migration, so persistent databases do not
meet them twice, and two theme tests no longer depend on the quoting and
decimals of SQLite.
@xiregroup
xiregroup added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit 1a6b1b0 Nov 18, 2026
15 checks passed
@xiregroup
xiregroup deleted the feat/cache branch November 18, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant