Using wp_cache_key to set the cache key dynamically
-
We need to be able to set the cache key dynamically, using different criteria depending on the user. The developer documentation is not very clear, therefore I was wondering if there is any example that shows how to achieve that result. From my understanding, the following should be sufficient:
function my_custom_cachekey($key) { if(custom_criteria_satisfied()) { $key .= 'some_custom_string'; } return $key; } add_cacheaction('wp_cache_key', 'my_custom_cachekey');
Is there anything else that we should set, or would that do the trick?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Using wp_cache_key to set the cache key dynamically’ is closed to new replies.