You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes the issue where url invalidation will no longer function after the cache has been cleared.
This is especially an issue when a cron is run that clears the application cache every so often.
When that happens the url cache keys will be removed, any kind of invalidation will no longer function.
This PR will use the recursiveDirectoryIterator functions to efficiently remove these files from disk if there are still some left over that were not in application cache.
Due to it being an iterator it's light on memory
Note: We could completely move to file based clearing instead of application cache. But for completeness, to keep other parts that might be watching the application cache in the loop i've decided to keep that as-is
indykoning
changed the title
[5.x ] Fix files not being removed after cache has been cleared
[5.x] Fix files not being removed after cache has been cleared
Jun 16, 2025
I've added tests, only windows seems to fail.
I think it has to do with the different path separators on windows but i do not have access to a windows machine.
Could you assist in updating the test to work for windows as well?
What you had was working on Windows, but the assertions weren't.
There were inconsistencies with the directory separators.
e.g. getFilePath would return something like /path/to/foo.html but the writer used a path like /path/to\foo.html. The right file was actually deleted, but since mockery cared about the literal string passed to the method, it was failing.
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
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 PR fixes the issue where url invalidation will no longer function after the cache has been cleared.
This is especially an issue when a cron is run that clears the application cache every so often.
When that happens the url cache keys will be removed, any kind of invalidation will no longer function.
This PR will use the recursiveDirectoryIterator functions to efficiently remove these files from disk if there are still some left over that were not in application cache.
Due to it being an iterator it's light on memory
Note: We could completely move to file based clearing instead of application cache. But for completeness, to keep other parts that might be watching the application cache in the loop i've decided to keep that as-is