• Resolved edzz83

    (@edzz83)


    Hi there, we cannot get multi currency working with booster.io plugin, we are using the feature currency by country.

    It seems page caches first load then it uses that for each further load. Please advise how we can get thits working, i see there was a previous fix for other plugins that use multi currency, booster is very popular i hope we can get a solution as we have tried everything and it only works when litespeed is disabled!

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

Viewing 4 replies - 16 through 19 (of 19 total)
  • Plugin Support LiteSpeed Lisa

    (@lclarke)

    Hi @edzz83

    I can’t really help much with figuring out what cookie to use or the steps you need to take (I’ll leave that for @stanleylitespeed), but I can explain a little bit of background that might make it easier to understand how it should work.

    From my understanding, this is what is happening:
    1) Booster (or woo) produce a GEOIP cookie.
    2) We need to get htaccess to VARY the cookie produced by Booster/Woo using the Apache GEOIP module we have installed.

    Basically. We believe that in order to determine which currency to display on your site, Booster is setting a particular cookie. And you need to tell LiteSpeed in .htaccess that you want to vary on that cookie.

    When you tell LiteSpeed to “vary” on a cookie, what you are really doing is instructing LiteSpeed to create a separate cached copy of the page for every different value of the cookie.

    So, if a user visits your site and the cookie indicates that he should use US Dollars, then LiteSpeed will look for a cached copy of the page that also uses US Dollars. If one doesn’t exist, it will be created, and it will be served to the next USD customer to visit the site. Another visitor might use Australian Dollars, in which case, LiteSpeed will look for a cached copy of the page using AUD, and so on.

    If there are ten visitors to your home page, and they use six different currencies among them, then there will be six different copies of your home page cached, and it’s all controlled by the value of the cookie.

    I hope this helps explain what the ultimate goal should be, and how it works. Now I’ll leave it to Stanley to help you get there.

    Plugin Support LiteSpeed Lisa

    (@lclarke)

    Sorry, I just went back and re-read the posts in this thread, and I believe I misspoke about the origin of the cookie. It looks like it’s not set by Booster, but by the server-side GEOIP solution, as Stanley said. My mistake.

    Everything I said about how varying on a cookie works, though, is still accurate.

    There’s another example on our wiki if you’d like to see it a different way.

    Sorry for the unclear instruction, as Cache Vary is a quite difficult concept, hope the following instruction could help you:

    1) Cache Vary is using .htaccess to separate cache because LiteSpeed server will send back response before reaching PHP code. So the cookies produced by PHP from Booster(or woo) is not useful on Cache Vary.

    2) After installing the GeoIP module, every request to the server will add some environment variables for Geo Location on .htaccess.

    3) Different GeoIP module will generate different variables, for example: https://dev.maxmind.com/geoip/legacy/mod_geoip2/.

    If you are using “GeoIP Legacy Apache Module”, you can use: GEOIP_CONTINENT_CODE, GEOIP_COUNTRY_CODE, GEOIP_COUNTRY_NAME..., you can find it from phpinfo();

    4) After you confirmed the variable you need to use, add RewriteRule .* - [E=Cache-Vary:YOUR_COOKIES_NAME] on .htaccess and you can go to check that does the cache created separately.

    Hope this explanation could help, if you still have any questions, please join our Slack channel and find me(Stanley Cheung at Litespeed) or submit a ticket here

    thanks for these instructions which work for me (I use WooCommerce Multi Currency Premium from Villathemes for anyone interested).

    I change my .htaccess as per instructions to:

    <IfModule LiteSpeed>
    RewriteEngine on
    CacheLookup on
    RewriteRule .* – [E=Cache-Control:no-autoflush]
    RewriteRule .* – [E=Cache-Vary:wmc_current_currency]
    RewriteRule ^min/\w+\.(css|js) – [E=cache-control:no-vary]

    </IfModule>

    And it works fine.

    The problem I have, is that the .htaccess warns:
    # BEGIN LSCACHE
    ## LITESPEED WP CACHE PLUGIN – Do not edit the contents of this block! ##

    And it is undoing/fixing my changes.

    So can you tell me where I put this extra line so it doesnt get wiped, please?

    btw – loving the speed of openlitespeed. My pages have gone from 25s to <5 on a smaller instance. Insanely fast.

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘litespeed + booster.io multi currency cache issue’ is closed to new replies.