[Fix][Routing] Bump route cache key version to v2#23
Merged
Conversation
Invalidates stale v1 route-cache blobs left by the previous maartenstaa/laravel-41-route-caching package. Those blobs serialized MaartenStaa\Routing\Route objects under the shared 'routes.cache.v1.*' key; after switching to Illuminate\CachedRouting the first post-deploy read of that key unserialized to __PHP_Incomplete_Class, causing 'call a method on an incomplete object' errors. Bumping the version changes the cache key so old blobs are never read again and routes regenerate cleanly on next request. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps the route cache key version from
v1tov2inIlluminate\CachedRouting\Router.What it fixes
The previous route caching came from
maartenstaa/laravel-41-route-caching, which serializedMaartenStaa\Routing\Routeobjects under the cache keyroutes.cache.v1.<md5(path)><mtime>. After migrating to nativeIlluminate\CachedRouting, the new code reused the same key format. On deploy, the first request read the stalev1blob andunserialize()produced__PHP_Incomplete_Class(classMaartenStaa\Routing\Routeno longer exists), throwing:Fix
Changing
cacheVersiontov2produces a fresh key (routes.cache.v2.*). Oldv1blobs are never read again and expire on their own TTL (24h), while routes regenerate cleanly on the next request — no manual Redis purge required on future deploys.🤖 Generated with Claude Code