• Hi

    We are using the pro plugin version with GEO Location and are running into an issue with W3c Caching.

    We are currently using the plugin on a site which uses W3C total cache for caching the front end pages. I am finding that the plugin will only work when caching is turned off, So if we visit a page and we are not logged in (caching on) then it will not update based on geolocation, or setting the location manually as it loads the cached version, generally the default city.

    When logged in, or a specific test page set to ignore for caching the plugin works as expected.

    As it was AJAX and calling admin-ajax script I wouldn’t have anticipated caching. Is there any advice on how this can work with the caching plugin? We basically need the caching on the pages, but then the JS/Ajax shouldn’t be loading anything cached.

    Any help would be greatly appreciated. I can provide url information privately as it is a client website who wouldn’t like me posting their address on questions such as this.

    Many thanks in advance.
    Mike

    • This topic was modified 5 years, 11 months ago by mikeypengelly.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Benjamin Denis

    (@rainbowgeek)

    Hi,
    I don’t know W3C Caching (I’m using WP-Rocket) but normally every Ajax requests should never be cached.
    There is probably an option to do that or to exclude something in the settings…

    Dear @mikeypengelly,

    I use also W3C and do not encounter the issue described by you. Try to check the following.

    • Login to your WordPress backend and select the W3C menu “Performance” on the left
    • Select “Page Cache”
    • Scroll down to “Advanced” and check the option “Never cache the following pages:” — default setting are
      wp-.*\.php
      index\.php

    @rainbowgeek: Thanks for the great plugin. With regards to caching in the plugin, you use set_transient and get_transient. Is there a reason, why you prefer to store the raw openweather API response instead of the processed result. Currently, caching saves the API call but still requires subsequent parsing of the result for every weather call. Wouldn’t it be great when the processing of the API response also needs to be performed once per cache interval?

    Cheers,

    Matthieu

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘W3 total cache’ is closed to new replies.