• I notice a strange behaviour related to Cache Enabler. Here is my test-case:

    1. When I activate the Woocommerce Setting – Geolocate (with page caching support), a visit on the page mentioned appends a variable to the URL (=?v=xxx). I assume this is a normal behaviour.

    2. a. When I activate Cache Enabler, I get a worldwide issue on the website which reads:

    <!doctype html> <meta charset="utf-8"> <title>Document moved</title> <p>Document has <a href="https://wiseable.io/product/prince2-foundation-online-training/?v=7516fd43adaa">moved here</a>.</p>
    
    <!-- Cache Enabler by KeyCDN @ 18.03.2018 16:08:46 (html) --><script type="text/javascript">
    //<![CDATA[
    window.__cfRocketOptions = {byc:0,p:1521385796,petok:"43e3d229a549058e553cdb5d884c3617c4d1e29e-1521385826-1800"};
    //]]>
    </script>
    <script type="text/javascript" src="https://ajax.cloudflare.com/cdn-cgi/scripts/935cb224/cloudflare-static/rocket.min.js"></script>

    2. b. Deactivating Cache Enabler doesn’t throw the error

    3. Enabling Cache Enabler and reverting the WooCommerce Setting to “Geolocate” does not through the error either.

    Any ideas ?

    • This topic was modified 6 years, 8 months ago by redvivi.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Does this error occur on every page for you or is it just certain pages? I just tried testing Cache Enabler with Woocommerce’s Geolocate (with page caching support) feature however could not replicate the issue.

    In my tests, Cache Enabler simply does not cache the page when the Geolocate (with page caching support) feature is active as that feature adds query strings.

    Have you tried disabling other plugins to see if there might be a conflict somewhere?

    Thread Starter redvivi

    (@redvivi)

    It seems that it is impacting all the pages

    I am a bit in a pickle because my site is currently live and switching Cache-Enabler breaks the access to my website. I have a staging website but only Admin can logged-in, which means that the issue can’t be seen.

    What would you recommend to troubleshoot the issue ?

    Thread Starter redvivi

    (@redvivi)

    Does “Document has moved here” coming from Cache Enabler ?

    Thread Starter redvivi

    (@redvivi)

    I think I narrowed it down to the Cache-Control plugin (which add/modifies cache control headers).

    For some reasons, when enabled, it generates this error. Still investigating.

    PS: with geolocate with page caching, there is no way to get advantage of the Cache-Enabler plugin?

    Thread Starter redvivi

    (@redvivi)

    Can it be the case that according to https://github.com/woocommerce/woocommerce/issues/9122, due to multiple 301 redirects when geolocate with page caching is enabled, somehow the redirect 301 is cached and therefore a kind of interlocking situation when 301 is cached in Cache-Enabler, Cache-Control headers prevent the page from refreshing from the back-end, and by consequence the cache is always hit whereas it should go tothe backend ?

    I don’t see multiple redirects when inspecting the network calls on our test instance, there is a single 307 on the HTML file. However, as stated in the thread you mentioned using query strings “keeps the URL unique to avoid caching”.

    Unfortunately, I’m unable to reproduce your issue as Cache Enabler simply does not create any cached files when the geolocate with page caching feature is enabled. Therefore there would be no advantage to using CE in conjunction with that feature.

    Thread Starter redvivi

    (@redvivi)

    Would it help to provide you access to the environment?

    Thread Starter redvivi

    (@redvivi)

    Actually it seems that the way WooCoomerce designed it was to have a specific v=hash per country.

    Cf https://woocommerce.wordpress.com/2015/07/02/making-geolocation-static-cache-friendly-in-2-4/

    I understand by extension that CE should still cache it…right?

    CE is configured to bypass cache by default when a query string is present. In the source code (under the bypass_cache function) you’ll find:

    // Request with query strings
            if ( ! empty($_GET) && ! isset( $_GET['utm_source'], $_GET['utm_medium'], $_GET['utm_campaign'] ) && get_option('permalink_structure') ) {
                return true;
            }

    Therefore it sounds as though there is something else that is conflicting with your setup. CE does not throw the “Document has moved here” message. I would suggest troubleshooting further by deactivating other plugins and reverting to a default theme if required.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Document has moved here & WooCommerce Geolocate’ is closed to new replies.