Hello,
I am using since a while the new and awesome "cache tags" feature that has been kindly added to F3.
Recently I needed to add some new functionality to my application and this functionality requires for whole groups of cached tags to be deleted from memcache.
That is, on memcache I have this kind of cache keys:
k7y6k0qmlx0f.2hfzyz5bm6uck.comp_company_rows_1_37d26pw12t8g8_25_1.sql
k7y6k0qmlx0f.2od9tulaeeqs0.comp_company_rows_1_37d26pw12t8g8_25_2.sql
k7y6k0qmlx0f.2oq00v8k78cg0.comp_company_detail_reg_1.sql
k7y6k0qmlx0f.3cbn22h9crggk.comp_company_rows_1_37d26pw12t8g8_25_0.sql
k7y6k0qmlx0f.6lk9rcohc7w8.comp_company_rows_1_37d26pw12t8g8_25_3.sql
In particular, I have keys created from a base cache tag name: "
comp_company_rows_", formatted with a number of additional numbers like 1, hash(string), 25, 1...N and similar, used to make them unique. The resulting "complex", formatted full tag names were then used to store query results on memcache.
Now, I need to delete every keys starting with
What took me by surprise is finding out how if I call this:
Cache::instance()->reset('comp_company_rows_');
it does
exactly what I need! That is, it deletes every memcache key whose tag starts with that prefix and not just the exact matches!
My question is: since it looks too good to be true, is this
the officially intended and supported behavior for reset()?
Or is this unintended and I can expect this perfect solution (for me) to be removed in the future?
Thanks in advance!