• Resolved dev

    (@devksec)


    Hello,

    We’re having compatibility issues with caching and WOOCs (Woocommerce currency convertor).

    It uses ajax to change currencies (when its anti-cache feature is enabled). W3TC by default excludes query string pages so when using WOOCS the requests bypass the page cache and are much slower than pages cached with enhanced disk cache.

    How can we cache pages with these query strings as separate pages? Putting “currency” as an accepted query string breaks WOOCs and the currencies won’t switch.
    ?currency=GBP
    ?currency=USD
    ?currency=EUR

    Another issue is a user is browsing with a different currency selected and W3TC has not cached that page before, W3TC will cache the page in the different currency. This means users browsing to the site get different currencies on different pages. WOOCs anti-cache feature kicks in after a few seconds and reloads the page with the right currency however the wrong one is still cached by W3TC.

    If we disabled WOOCs anti-caching features (Ajax currency switch), when pages are cached wrong currency they stay that way.

    Many thanks for your help again!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @devksec

    Thank you for reaching out.
    Just to confirm, the plugin you are referring to is this one?
    Please confirm this so I can investigate this more.
    THanks!

    Thread Starter dev

    (@devksec)

    That is correct! Appreciate your help.

    We did raise this with them here: https://wordpress.org/support/topic/slow-switching-speed/#post-14856747

    They have a setting called “No GET data in link” Which removes the queries “?currency=GBP” from GET and W3TC then loads the cached page however it takes up to 5 seconds for WOOCs to then switch currencies via AJAX.

    However, by having them as GET queries, it then slows down the site for the customer due to the main page being excluded from caching.

    This is seperate from the other issue were unauthenticated customers are causing pages to be cached in different currencies. Pre-loading helps here but can’t pre-load the whole site constantly. Currently 10 pages every 5 mins

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @devksec

    You are correct when you are saying that when using Disk: Enhanced the pages with query strings are not cached.
    So for that, you should use Disk: Basic or some memory-based caching method and enable the option Cache URIs with query string variables in Performance>Page Cache.
    However, this may cause that the pages are cached with the currently the last user used/visited.
    As I can see in the WOOCS documentation:

    Compatibility with cache plugins: if your site uses any cache plugins enable the option ‘I am using cache plugin on my site’, reset the site cache and from now your shop visitors can switch currencies without any problems!

    This indicates that the plugin is fully compatible with caching.
    They also have AJAX queries for prices redrawing.
    If I understand correctly, do you want pages with currencies to be cached and be served as cached to the users that select the desired currency?
    Thanks!

    Thread Starter dev

    (@devksec)

    Hello,

    We can testing switching to basic disk caching with Memcached and enable “Cache URIs with query string variables”. Currently the “Cache URIs with query string variables” is grey’d out, any idea what could be causing this ?

    So we’re looking to achieve 2 things:
    1. Improve performance with the currency switching query strings (As this bypasses enhance disk caching) – DB caching is enabled however could tweaks be made here or this is solely related to page caching ?
    2. Ensure pages are not being cache from unauthenticated customers in any currency that is not the base currency. E.G GBP is set however customers browsing the site with Euro may cache the page for everyone in euro.

    Many thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @devksec

    The “Cache URIs with query string variables” is greyed out because this does not work with the Disk: Enhanced caching method fr Page Cache.
    If you cache the pages with the query string then the string does not have the effect it suppose to have and that is to show different currency when switched.
    W3 Total Cache can only cache pages and serve cached pages for the visitors. So naturally, when the cache is purged the page is cached on the first visit. If the currency on the first visit is set to EUR this will be cached. The Ajax call and the option “I am using cache plugin on my site” should take care of this.

    How can we cache pages with these query strings as separate pages? Putting “currency” as an accepted query string breaks WOOCs and the currencies won’t switch.

    As I’ve mentioned before, you need to use a different caching method than Disk: Enhanced and enable the Cache URIs with query string variables option.
    I hope this helps!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WOOCs compatibility’ is closed to new replies.