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

Why is $wpdb->delete cacheable? #864

Closed
barryceelen opened this issue Mar 3, 2017 · 3 comments
Closed

Why is $wpdb->delete cacheable? #864

barryceelen opened this issue Mar 3, 2017 · 3 comments

Comments

@barryceelen
Copy link
Contributor

Noob question (and probably not directly related):

The delete method is marked as cacheable in DirectDatabaseQuerySniff.php. Why would I want to cache a DELETE query?

@JDGrimes
Copy link
Contributor

JDGrimes commented Mar 3, 2017

Not entirely noob, there was some confusion about this back in #180 (from me 😊). The fact is though, that if you added something to the cache at some point, then you will probably want to remove it from the cache when it is deleted, to free up the cache. So that's why $wpdb->delete() is still flagged—not to add to the cache, but to delete from it.

@JDGrimes
Copy link
Contributor

JDGrimes commented Mar 3, 2017

Maybe there is a way that we can make this more obvious though?

@barryceelen
Copy link
Contributor Author

…which reminds me to check existing issues before opening a new one 🙈.
Thanks @JDGrimes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants