Support » Plugin: W3 Total Cache » Cookie group not working on posts/page

  • Resolved pm1932

    (@pm1932)


    Hello,
    I have the community version of the plugin setup with page caching (enhanced disc). I also have a cookie that displays a different menu based on it’s value. There are only two states. I have this set up in the cookie groups:

    menu_b
    my_cookie=menu_b

    this is correctly causing two versions of the homepage to be saved. one at _index_ssl.html and another at _index_menu_b_ssl.html this seems to work perfectly for the homepage and any archive page. two versions are saved each with the correct menu.

    The issue I’m having is that any single page/post does not work. if I view a page with the cookie set to menu_a it will save the _index_ssl.html then I switch to menu_b and try to view the same page and it will create _index_menu_b_ssl.html but the content of this page will be the same as menu_a. I can also reverse this process, and get the adverse. I’m guessing that on the first visit of the page with the cookie it’s loading the cached page to create the new cached page instead of loading the page from wordpress. Another way – it’s correctly identifying that the page has a cookie and needs to generate a new cached page but it’s caching the wrong content (basically just duplicating the already cached page).

    I’ve also tried setting up two cookie groups menu_a and menu_b but got the same results.

    Any help would be appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Well, from my experiences, you shouldn’t use page cache while having Web pages like webshop, etc.

    Because, yes, exactly that happens either if you use for example nginx fastcgi cache.

    It re-writes your cached file always.

    So, try the workaround, to bypass or with CloudFlare bypass by cookie installing Railgun.

    Or, re-write your PHP code to check if cookie A or cookie B, display the corrent menu?

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @pm1932
    Thank you for your inquiry and I am happy to assist you with this. @fritex Thank you for your post.
    @pm1932 You should use Cookie Groups for this and assign a set of Cookies to ensure that a unique cache is created for each Cookie group.
    I also need to inform you that “Cookie Groups” is a feature that is only available after upgrade to the Pro version of the plugin.
    I hope this helps!

    thank you @fritex and @vmarko

    @vmarko I upgraded to the pro version and it’s still not working. Basically no change. the cookie groups continue to work perfectly on the homepage and archives as they did with the community version. but single pages/post still save a version based on the cookie but it’s a duplicate of the already cached file not a new file with the correct menu. Pretty sure it’s just loading the cached page and then making a copy of that instead of generating and saving a new page.

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @pm1932

    Just to let you know here that we received your email and we are checking this!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.