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

Document suggestion for cache invalidation #66

Open
denudge opened this issue Oct 17, 2020 · 3 comments
Open

Document suggestion for cache invalidation #66

denudge opened this issue Oct 17, 2020 · 3 comments

Comments

@denudge
Copy link

denudge commented Oct 17, 2020

Since the PHP stack is out of reach, I don't see how cache invalidation works.
For example, to renew the generated start page of a content driven site every 10 minutes.
Please provide a suggestion how to handle that.

Thanks in advance.

@jberculo
Copy link

I don't see that either, but you could schedule the artisan command for the specific slug.

One could also use this to create an observer that clears the specific cache entry when saving a model. I have not used his package for now, but the availability of this command suggests that there also is a call that can be made without using the scheduling functionality. It would be nice if that would be documented, though.

@jberculo
Copy link

jberculo commented Nov 12, 2020

I added the something like this to an observer, and it works:

$cache = app()->make(Cache::class);
$cache->clear($slug);
$cache->forget($slug);

@deevus
Copy link

deevus commented Apr 7, 2021

I was thinking about how to do this as well. However, in my case we have more than 1 web server in a serverless context, so cache invalidation needs to be propagated across all of them.

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

No branches or pull requests

3 participants