Skip to content

Cache the vendored brain mesh as immutable - #566

Merged
neuromechanist merged 1 commit into
stagingfrom
fix/brain-mesh-cache
Nov 19, 2026
Merged

neuromechanist merged 1 commit into
stagingfrom
fix/brain-mesh-cache

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Release review of #565 suggested it: the 532 KB template surface under /vendor/brain-templates/mni152nlin2009casym@1/ had only the Pages static defaults, so readers who reopen the Brain panel revalidate or re-download it.

  • public/_headers: Cache-Control: public, max-age=31536000, immutable for that folder. The folder is versioned (@1), so a rebuilt surface goes in a new folder and never changes bytes under one URL.
  • test/brain-template-vendor.test.ts: pins that the rule names TEMPLATE_DIRECTORY (the folder the panel fetches), that the folder is versioned, and the header value.

Testing

  • bunx vitest run test/brain-template-vendor.test.ts test/bids-validator-vendor.test.ts: 42 passed.
  • Biome check on the changed test file: clean.
  • After deploy: the mesh response carries the header (static assets only; _headers does not apply to worker output).

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying nemar-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: c59822a
Status: ✅  Deploy successful!
Preview URL: https://7cf97284.nemar-website.pages.dev
Branch Preview URL: https://fix-brain-mesh-cache.nemar-website.pages.dev

View logs

@neuromechanist
neuromechanist merged commit fc20653 into staging Nov 19, 2026
5 checks passed
@neuromechanist
neuromechanist deleted the fix/brain-mesh-cache branch November 19, 2026 15:19
neuromechanist added a commit that referenced this pull request Nov 19, 2026
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