Skip to content

Keep the GraphQL schema array under the version token of the other local caches - #10

Merged
paales merged 1 commit into
mainfrom
claude/fastboot-schema-version-token
Oct 10, 2026
Merged

paales merged 1 commit into
mainfrom
claude/fastboot-schema-version-token

Conversation

@paales

@paales paales commented Oct 10, 2026

Copy link
Copy Markdown
Member

Problem

The schema array ("schema L1") had its own Redis client, its own keys and its own invalidation plugins. It only ran when fastboot.schema_l1 was configured (enabled plus an installation id), and it needed Redis. Every other FastBoot cache already solved the same problem through Magento's cache API: local PHP files under a version token in Magento's cache, with a fence on each write.

Solution

FastBootGraphQl/Model/Config/OpcacheData (the class behind Magento\Framework\GraphQl\Config\Data) now uses PhpFiles (group SCHEMA, id = the schema cache id):

  • When the schema_array switch is on and the config cache type is enabled, a file hit is merged, and the config cache and the reader are not read.
  • On a miss, it captures the version, runs Magento's normal initData() (config cache, or reader plus save) and writes the array with the captured version. A clean on any server during the build makes PhpFiles refuse the write.
  • In all other cases it runs Magento's path only.

A save of a fresh build to the config cache also changes the version. As a result, the request that builds the schema writes no file, and the next request writes it from the config cache. This is why fastboot:prepare already reads the schema twice. The Plugin/Schema/Reset version bump stays. The feature needs no configuration, works on every Magento cache backend and is on by default. An existing fastboot.schema_l1 block in env.php is not read.

Deleted

  • FastBootCache/Model/Schema/{Settings,Remote,Local,Metrics}.php
  • FastBootGraphQl/Plugin/Schema/{Invalidate,Flush}.php and their di.xml wiring, plus the Settings di.xml entry
  • The Redis check and the schema_l1 lines in fastboot:status
  • colinmollenhour/credis (root composer.json) and the ext-redis suggestion (FastBootCache)
  • dev/tests/schema-l1/*, dev/tests/without-redis.py, the CI Redis service, the schema and without-redis steps, and the Redis cache backend and schema_l1 block of the CI fixture
  • SchemaSettingsTest, plus the Settings part of ReleaseTest

Tests

OpcacheDataTest is rewritten and covers these cases:

  • A file hit.
  • A miss with a build, written with the version captured before the build.
  • A miss from the config cache.
  • The switch off, and the config cache disabled: Magento's path only, with no read and no write.
  • A file from one request serves the next (real PhpFiles).
  • A version change during the build refuses the write (real PhpFiles).
  • A 1.6 MB schema fits the default max_entry_bytes.

Docs updated: root README, FastBoot, FastBootCache, dev/ARCHITECTURE.md, dev/README.md, dev/tests/README.md, dev/ci/README.md, CLAUDE.md and CHANGELOG.

🤖 Generated with Claude Code

https://claude.ai/code/session_01P4jLu4fTNqMe3WuJern5CW


Generated by Claude Code

…cal caches

The stitched schema stays a local PHP array that a request includes from
OPcache, but it now uses the same storage, version token and write fence as
every other FastBoot cache, through Magento's own cache API. It needs no
configuration, works on every Magento cache backend and is on by default
under the schema_array switch. The separate Redis transport, its settings,
its invalidation plugins, its test suites and the Credis requirement are
removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P4jLu4fTNqMe3WuJern5CW
@paales
paales merged commit 5b9a55b into main Oct 10, 2026
6 checks passed
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.

2 participants