• Resolved gibonwebbuppsala

    (@gibonwebbuppsala)


    I have a site with WooCommerce where customers can log in to get role-based prices. The prices are served via REST. So, what I really want is for the logged-in users to be served the Public Cache and not the Private Cache, which I understood was not possible, correct? The site has over 2,000 pages, so I’d rather not add varies if not absolutely necessary.

    As a result, I’ve come to the conclusion that I need a variation for the WP Role that the logged-in users have (Reseller). After reading the documentation, I realized that to achieve this, I need to:

    • Turn off “Cache Logged-in Users.”
    • Create a variation group for the role under the “ESI” tab.
    • Create a “Dummy User,” assign the role to it, and simulate that user in the crawler.

    However, this does not work at all. After extensive troubleshooting, I discovered that ESI needs to be enabled. In the documentation, it explicitly states that it does not need to be enabled. Am I misunderstanding something here, or is the documentation wrong?

    I also found a workaround, if I add this action to functions, the ESI-option do not seem to be enabled.

    do_action( 'litespeed_control_force_public' );
Viewing 1 replies (of 1 total)
  • Plugin Support qtwrk

    (@qtwrk)

    what you asking is against plugin’s logic , only way to make it happen is to modify plugin code , but that could lead to unforeseeable issues and the modification will be wiped when upgrading.

    if your price is retrieved by REST API , then best thing you can try is enable ESI , ideally , this will create a “login user public cache” among them , but this may not be compatible with some themes , specially if you have username display in header

    and worth to mention , ESI requires LiteSpeed Enterprise or QUIC cloud CDN , OpenLiteSpeed and other webserver don’t support ESI.

Viewing 1 replies (of 1 total)
  • The topic ‘Serve Public to Private or create Vary for Role’ is closed to new replies.