GeoIP breaking the cache
-
I got a problem using GeoIP enabled on the server, the plugin doesn’t use this information and it can’t make a proper cache for the pages, it serves the same cache for all countries. In my case I needed to remove some content for certain contries, breeze must treat each page like working in multisite, separating the cached page for that country.
Reading the plugin I didn’t find any implementation for GeoIP so I built mine with the code below.
File: breeze/inc/functions.php function breeze_get_cache_base_path($is_network = false, $blog_id_requested = 0) { [...] // GeoIP $continent = getenv('HTTP_X_FORWARDED_CONTINENT'); $country = getenv('HTTP_X_FORWARDED_COUNTRY'); if ($continent && $country) { $path .= $continent . DIRECTORY_SEPARATOR; $path .= md5($country) . DIRECTORY_SEPARATOR; } return $path; }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.