How do I generate separate cache files based on a cookie key?

You can use the `wpo_cache_cookies` filter to generate separate cache files. For example, you may want to generate separate cache files for different currencies. You can modify and use the following code snippet to do so:

<?php
add_filter('wpo_cache_cookies', 'myprefix_add_cache_cookies', 20, 2);

function myprefix_add_cache_cookies($cookies) {
if (// Check if some feature exists that needs separate cache) {
$cookie[] = 'cache_key_that_needs_separate_cache';
}
return $cookies;
}

Posted in: Cache