• 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)
  • Plugin Author owaisalam

    (@owaisalam)

    Thank you for sharing this approach. While it does work, we’d like to highlight that using md5 is generally discouraged, as it may lead to false-positive detections. Additionally, the breeze_get_cache_base_path function is used in other areas, and in some cases this could result in cache files not being fully cleared during a purge.

    To ensure a reliable and long-term solution, we can work on a permanent compatibility fix. For that, we’ll need a bit more information from your side. Could you please let us know which GeoIP solution the site is using (for example, a plugin or theme)? This will help us properly test and validate the fix.

    We appreciate your cooperation and look forward to your response.

    Thread Starter Edir Pedro

    (@edir)

    • Enabled GeoIP on Cloudways server;
    • Default configurations for Varnish and Breeze, no custom cache;
    • No plugins managing GeoIP or other kind of cache;
    • The website needed to remove some products for certain contries, they can’t be listed on the pages. I built a solution on the theme that removes the products from the queries according to the country, this hides the products in any wp function called on the theme.
    • Users in Brazil can see all the products, users in Canada don’t see some products on the list; Breeze needs to cache the pages for each country to work properly.
    Plugin Author owaisalam

    (@owaisalam)

    Thanks for sharing the details. We’ve reviewed your case. Could you please confirm whether you have already contacted Cloudways Support regarding this issue?

    Thread Starter Edir Pedro

    (@edir)

    Yes, I made a request there #763910.

    Plugin Author owaisalam

    (@owaisalam)

    Thanks for your reply. We will coordinate with our support team regarding this and will share our findings with you once we have more details.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.