I have a few panes on my user profiles that I want to clear the caches of for a specific user when that user's account is updated.
I thought I would be able to do this by appending 'uid:%user:uid' onto the cache key of each of these panes and setting a rule to 'Clear a specific cache cid' matching uid:[account:uid] + wildcards (e.g. %uid:[account:uid]% with 'use wildcard' ticked)
However, whilst I can see in the DB that the cache ids are being created fine if I use the context replacements as a suffix, the cache key is not generated properly (i.e. without the context key word or the unique id specific to the pane).
And when I use the replacement as a suffix, if I try to use the clear cid action with wildcards, nothing happens - nothing is cleared from the cache. I figure this is probably because I'm using the wrong character as a wildcard though, as this isn't documented. I tried * and %. What should I be using instead?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1515164-3-cid-clearing.patch | 755 bytes | bradjones1 |
| #2 | 1515164-1-cid-clearing.patch | 879 bytes | bradjones1 |
Comments
Comment #1
Thomas_S commentedIt would be nice if we could use wildcards like in php.
I think you can't use wildcard sign in combination with the url. it runs with the left part of the url
example: [site:url]news/ clears all cid like SiteUrl/news/xyz
the wildcard * alone clears the complete bin.
(sorry for my bad english)
Comment #2
bradjones1The problem described above (cid wildcard clearing not working) also plagued me, until I started doing some basic debugging. It turns out when I explicitly cast the "boolean" in the rules configuration (which actually comes in as an integer) to a bool type, it works as expected. This patch also includes a quick fix to the doxygen comment for this function.
Comment #3
bradjones1Same patch as above but without the errant extra newline at the end of the file. Also tagging as code bug.
Comment #4
szantog commentedPatch #4 correct. Marked as major, because without this the module is unusable with memcache.
Comment #5
fabsor commentedCommited. Thanks!
Comment #6.0
(not verified) commentedoop