memcached - memcache and wildcards -
I'm thinking that there is a way to clear memcache to use wildcards for key values.
Say that I have a cache with the key "1234 ~ fu" and the second "1234 ~ foo ~ bar".
Is there any way that I have clarified both ("1234 *") and above it?
I hope that makes sense.
Thank you.
No, there is no easy way to do this. This address, and provides a type of solution:
Removal by Nameshorn
While Memcached does not support the removal or removal of wildcard of any type by namespace ( Since there are no namespaces) there are some tips that can be used to emulate them require additional trips on the memcached server.
Example, to use a named location called PHP:
$ ns_key = $ memcache-> Get ("foo_namespace_key"); // If not set, start it ($ ns_key === incorrect) {$ ns_key = rand (1, 10000); $ Memcache- & gt; Set ("foo_namespace_key", $ ns_key); } // Cleverly use ns_key $ my_key = "foo_". $ Ns_key "_ 12345"; $ My_val = $ memcache- & gt; Get ($ my_key); // To clear the namespace: $ memcache-> Increase ("foo_namespace_key");
Comments
Post a Comment