-
Notifications
You must be signed in to change notification settings - Fork 198
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
Fix course structure ordering cache #4236
Conversation
A cache error happened when using memcached to store object cache. So it avoids the cache when using extension for object cache.
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 works well! I had one tiny comment, but not a big deal at all if you think you'd prefer merging as-is.
* @return string Where with extra condition to avoid cache. | ||
*/ | ||
public function filter_no_cache_where( $where ) { | ||
return $where . ' AND ' . time() . ' = ' . time(); |
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.
I don't think this would ever happen, but I wonder if it is a tiny-tiny-tiny bit safer to set time()
to a variable here. I mean, we'd have to be really unlucky and I doubt PHP would ever do that.
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.
Ah, of course! Fixed here: c0fffe1
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.
🚢
Fixes #3891
Changes proposed in this Pull Request
memcached
for object cache. With Redis, using the plugin "Redis Object Cache" I couldn't reproduce the issue.WHERE
query. It seems the way that solves for any extension. My first option was trying to clear some cache objects, but in the plugin I used, for example, it had some specific names, so we couldn't clear it in a generic way for any object cache extension.Testing instructions
You can configure your local env (2 first steps), or you can test it in Pressable or an Ephemeral site.
memcached
.memcached
. I used the plugin Docket Cache for this.