Skip to content

LTRAC-3132: feat(catalyst) - Let Storefront Hosting projects tune the tag cache - #3365

Open
jorgemoya wants to merge 3 commits into
canaryfrom
jorgemoya/ltrac-3132-read-tag-cache-options
Open

jorgemoya wants to merge 3 commits into
canaryfrom
jorgemoya/ltrac-3132-read-tag-cache-options

Conversation

@jorgemoya

@jorgemoya jorgemoya commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

What/Why?

Refs LTRAC-3132. Design in LTRAC-3130.

catalyst build copied the OpenNext config template unchanged, so projects couldn't tune the tag cache. It now reads a tagCache key from a committed catalyst.config.json, and --tag-cache-* flags or CATALYST_TAG_CACHE_* env vars override it for a single build (build and deploy).

Option Default Allowed
softReplicas 1 1–4
hardReplicas 1 1–2
regionalCacheTtlSeconds 30 10–300

Shards stay fixed at 4. Out-of-range values and unknown keys fail the build before it starts. The build log prints the settings it used.

Testing

Unit tests for defaults, overrides, bounds, flags and env vars. Compiled the template with esbuild to confirm the values are inlined. Checked --help and the out-of-range error on a built CLI.

Migration

None. Projects without catalyst.config.json keep today's defaults.

…fig.json

`catalyst build` copied the OpenNext config template unchanged, so a
Storefront Hosting project couldn't tune the tag cache for its traffic.

The build now reads a `tagCache` key from a committed
`catalyst.config.json`, so CI builds use it too. It validates shards
(1-8), soft and hard replicas (1-2) and the regional cache TTL (10-300s),
writes them to `.bigcommerce/tag-cache.json` for the template to import,
and logs the settings it used. Without the file, today's defaults apply.

Refs LTRAC-3132
…d env vars

CI pipelines can tune one build without editing catalyst.config.json.
`catalyst build` and `catalyst deploy` accept `--tag-cache-*` flags with
`CATALYST_TAG_CACHE_*` env var fallbacks. They override the file, share
its bounds, and the build log names any value that came from one.

Refs LTRAC-3132
@changeset-bot

changeset-bot Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c9ef29

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
catalyst Ready Ready Preview Dec 2, 2026 2:08am UTC

Request Review

@jorgemoya
jorgemoya marked this pull request as ready for review December 2, 2026 01:42
@jorgemoya
jorgemoya requested a review from a team as a code owner December 2, 2026 01:42
…replicas

More shards add no read capacity for pages that touch many tags, and
every key in the strict schema is hard to remove later, so shards stay
fixed at 4. Soft replicas now go up to 4: soft (path) tags are rewritten
only on `revalidatePath`, so extra replicas add read headroom for almost
no writes. Hard replicas stay capped at 2, since cart, checkout and
customer tags are rewritten on every cart and account change.

Refs LTRAC-3132

This branch was successfully deployed

1 active deployment
Preview — 0c9ef291 Deployed Dec 2, 2026 by vercel[bot]
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