Skip to content

Add versionCache to key cached predictions by checkpoint revisions - #57

Merged
marcreichel merged 3 commits into
mainfrom
feat/versioned-cache-15
Oct 12, 2026
Merged

marcreichel merged 3 commits into
mainfrom
feat/versioned-cache-15

Conversation

@marcreichel

Copy link
Copy Markdown
Owner

Summary

  • Add an opt-in versionCache option (LAYA_CACHE_VERSIONED in Laravel, off by default) that adds laya-serve's checkpoint revisions to the cache keys, so a checkpoint upgrade stops serving old answers.
  • On the first lookup per instance, /health is called once and its revisions are hashed into laya.<revisionhash>.<bodyhash>. The hash is kept in memory and in the cache for 60 s, so short-lived processes don't each call /health.
  • If /health fails or reports no revisions, the plain key is used and the prediction still succeeds. Cache errors on the revision hash dispatch CacheFailed.
  • Works for predictMany(). With the option off, keys and requests are unchanged.
  • README Caching section, config and .env docs updated.

Closes #15

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4d883a82-4294-4ce1-bfda-a47f4fd8b805

📥 Commits

Reviewing files that changed from the base of the PR and between 41de53c and 993679d.


📒 Files selected for processing (6)
  • README.md
  • config/laya.php
  • src/Laravel/LayaServiceProvider.php
  • src/Laya.php
  • tests/CacheTest.php
  • tests/LaravelTest.php

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@marcreichel
marcreichel enabled auto-merge October 12, 2026 20:16
@marcreichel
marcreichel disabled auto-merge October 12, 2026 20:22
@marcreichel
marcreichel merged commit 05b89be into main Oct 12, 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.

Opt-in: invalidate cached predictions when laya-serve's checkpoints change

1 participant