Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] Flush entire static_cache cache store when running static:clear #9770

Conversation

duncanmcclean
Copy link
Member

This pull request changes how we clear Static Caching related items from the Laravel cache.

Previously, when the static cache was cleared (either via php please static:clear or other means), we looped through the nocache::urls and cleared the regions from the cache.

This makes sense if we're using the "default" cache store. However, #9405 introduces a new, dedicated static_cache cache store for all things static caching related.

So, instead of us just clearing the keys we can find, this pull request changes our approach to flush the entire static_cache cache store.

If the application doesn't have a static_cache cache store, then it'll fallback to the previous implementation.

Fixes #9765.

@duncanmcclean duncanmcclean marked this pull request as draft March 21, 2024 12:12
@duncanmcclean duncanmcclean marked this pull request as ready for review March 21, 2024 12:26
@jasonvarga jasonvarga merged commit c4729f5 into 4.x Mar 21, 2024
35 checks passed
@jasonvarga jasonvarga deleted the fix/flush-entire-static-cache-store-when-running-cache-clear-command branch March 21, 2024 18:38
@jasonvarga
Copy link
Member

I think the underlying issue is more that we aren't keeping track of all keys properly. Or it has something to do with configs changing without clearing caches. Anyway, this PR is a simple quick win. 👍 Thanks!

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.

static-urls-cache folder not clearing
2 participants