-
-
Notifications
You must be signed in to change notification settings - Fork 597
Static cache: properly support multisite and async queues #6621
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
Static cache: properly support multisite and async queues #6621
Conversation
jasonvarga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working well when it's the individual urls getting invalidated.
e.g. you save an entry, and that entry's url gets invalidated.
What's not working is when you have an array of 'urls' to invalidate from the config.
'invalidation' => [
'rules' => [
'collections' => [
'blog' => [
'/blog', // only does http://site1.com/blog. it won't invalidate `site2.com/blog`
],
],
],
]Since you typically define relative the urls in the config, when it looks through, it doesn't pass along the domain.
This sorta thing:
$this->cacher->invalidateUrl(...$this->splitUrlAndDomain($url));What we could probably do is in AbstractCacher@invalidateUrls, for each item, if they're not already an absolute URL, add the base url onto the start of it.
Then we can have support for invalidating multi-domain urls by telling people to define absolute urls in their config. That'd solve #6397.
'invalidation' => [
'rules' => [
'collections' => [
'blog' => [
'/blog', // assumes http://site1.com/blog
'https://site2.com/blog', // since its defined absolute, we dont have to assume.
],
],
],
]|
Thanks, good point! I've been working on a fix, still have to add some tests later. |
|
Allright the Tests were added for both |
|
🎉 |
|
Still an issue on 3.3.67 I'm afraid. |
|
Yes, also on 3.4.7 |
Fixes #3291. Fixes #6397.
Invalidating URLs in the static cache should work well now on multisite and when using async queues*. On multisite, when you update an entry, it will also invalidate the URLs of the descendants of that entry.
*When using with async queues, you must have your APP_URL set to the right value.