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

[5.x] Use cache locks in static cache #10370

Merged
merged 2 commits into from
Jul 10, 2024
Merged

[5.x] Use cache locks in static cache #10370

merged 2 commits into from
Jul 10, 2024

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Jun 26, 2024

This swaps the lock in the Static Cache middleware from a hardcoded file-based Symfony Lock to Laravel's cache-based atomic lock.

This will allow people that use a horizontal scaling approach to use a more appropriate cache driver for locks. e.g. Redis.

This will use the same static_cache cache store if it exists. Docs

This also moves the locking behavior to only around the writable bits. If there's a cached response available to be served, it will be served without waiting for the lock.

@jasonvarga jasonvarga closed this Jul 1, 2024
@jasonvarga jasonvarga reopened this Jul 1, 2024
@jasonvarga jasonvarga merged commit 976ff8f into 5.x Jul 10, 2024
34 checks passed
@jasonvarga jasonvarga deleted the static-cache-lock branch July 10, 2024 17:47
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.

1 participant