Request: add_filter for page cache key
-
Around line 1363 in plugins/w3-total-cache/PgCache_ContentGrabber.php, adding a filter there could allow for creative repurposing of $key (the page cache key)
For example, I need to vary the cache by the country code based on GeoIP. Adding this in manually (hack) works perfect so far I can tell. It would be great if there was a proper way to do this without hacking the plugin. I hunted everything I could and it looks like there is a way to alter the key but only if filtering is happening, which it is not in this case.
$key .= ‘_’ . $_SERVER[‘HTTP_GEOIP_COUNTRY_CODE’];
I don’t see any issue with adding this in, only possible benefits and creative ways to utilize the cache even better (could even override it with the user’s ID, or any other headers, $_SERVER/$_ENV, etc, if page caching makes sense based on that dimension!)
I would have submitted a PR if there was a git repo, but it looks like it’s still back on SVN?
The topic ‘Request: add_filter for page cache key’ is closed to new replies.