Updated: Comment #N
Problem/Motivation
There are a handful of calls like: cache()->deleteTags(). This is just not correct. This only works properly at the moment because core happens to only use db cache bins. If you were to switch any cache backends out, these calls will break.
This should not be possible to get wrong, but it is currently. Until we fix the whole bins/tags stuff. This should still be fixed here though.
Proposed resolution
Replace these with calls to Cache:: instead.
Remaining tasks
Do it
User interface changes
None
API changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | interdiff-2175823-13.txt | 707 bytes | damiankloip |
| #13 | 2175823-13.patch | 20.87 KB | damiankloip |
Comments
Comment #1
damiankloip commentedComment #2
catchComment #3
olli commentedWhat about calls like $this->cache->deleteTags() or \Drupal::cache($this->cacheBin)->deleteTags() or cache($this->cacheBin)->deleteTags() ?
Comment #4
damiankloip commentedYes, totally right. we need to get those too.
I left the backend tests doing what they are doing, just calling ->deleteTags on themselves. I think it's ok to leave that for now?
Comment #6
olli commentedShould we rename these two methods in CacheBackendInterface?
Comment #7
damiankloip commentedYou fixed the tests, thanks!
I think we should see how #918538: Decouple cache tags from cache bins goes, but I don't think this issue should try to cover that.
Comment #8
dawehnerCan we please open a follow up to put this information onto the CacheBackendInterface? I do not see how you should know from reading the CacheBackendInterface.
Comment #9
webchickSince catch moved this to major, he's probably in the best position to ensure that it's solved to specification. :)
Comment #10
catch@dawehner we either need to do that, or go ahead with #918538: Decouple cache tags from cache bins which would remove this method from the interface altogether.
Was going to commit it, but it no longer applies (yes, already).
Comment #11
damiankloip commentedRerolled.
Comment #13
damiankloip commentedDoh
Comment #14
dawehnerThank you
Comment #15
catchComment #16
wim leersYES! THANK YOU!
This confused me enormously when I was first learning about cache tags. This is MUCH better.
Thanks!