[6.x] Regenerate Glide images when the cached file is missing - #15199
Open
duncanmcclean wants to merge 1 commit into
Open
[6.x] Regenerate Glide images when the cached file is missing#15199duncanmcclean wants to merge 1 commit into
duncanmcclean wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Specifically on S3 disks this is going to cause a slowdown as there will be a HEAD operation to check existence now which is going to introduce round trip latency for every image. |
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.
This pull request fixes a long-standing issue where Glide would throw an
Unable to read file from location: containers/...exception when a previously generated image no longer exists on the cache disk.This was happening because the
ImageGeneratorremembers the path of every generated image forever in theglidecache store, but never checks the file still exists. Whenever the generated file went away without the cache entry going with it — a deployment wiping the cache directory, manual deletion, or changing theimage_manipulations.cacheconfig option (which changes the cache disk without invalidating the store) — the stale path was returned and anything reading it would throw. Depending on where that happened, this surfaced as a 500 when serving the image, or as exceptions from addons like Responsive Images.This PR fixes it by treating a remembered path whose file is missing as a cache miss: the entry is forgotten and the image is regenerated.
Fixes #7350