• Resolved blaqshark

    (@blaqshark)


    Hi,
    When guests visit my site, my pages and woocoomerce product pages are super fast cus of public cache plus crawler but when customer logged in its very slow cus its no cache.i dont wanna use private cache or esi block options.Cus i dont have any customize or private pages for logged in user.Even only my cart page have my last view products so serving public cache to logged in users not going to breake anything.So i checked previous topics find solution. And in one of topic support answered that in LS setup i have to put “/” to Force Public Cache URIs section and force not to cache wp-admin area for serving public cache to logged in users.So i tried to put “/” to Force Public Cache URIs section and yeah its work but i couldnt figure out to not cache wp-admin area.Now my wp-admin area is caching too.So then instead of putting “/” , i tried to put:
    /$
    ^/product-categories/
    ^/products/
    ^/brands/
    /shop/$
    to Force Public Cache URIs section.But it didnt work.
    So whats the easiest way to serve public cache to logged in users exclude wp-admin area.And pls can you explain simple way how to exclude wp-admin area not cache.I tried everyting but still i couldt figure out.
    Also can you put option in lssetup serve public cache to logged in users.Cus google search console evaluating web vital scores from user experince.So this is the reason im getting higher score in pageinsignt in guest mode but cant pass in web vitals in search console cus of logged in users having slow performance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter blaqshark

    (@blaqshark)

    And also i discovered another problem, even i achieve serving public cache to logged in users.Logged in users cant get benefit from crawler cache features its only works for guests.So when guest visit the page cache:hit but the logged in users visit the page it miss then second time cache:hit.

    Hi,

    The way I see it, you’ve already set up cache-control to cache for logged-in users; it’s just that the crawler is not warming them up as it does for the non-logged-in users. The solution for you is under the [5] Simulation Settings tab of LiteSpeed Cache Crawler where you’ll enter the logged-in user ids to be simulated in the Role Simulation box so that the crawl will pre-cache your site as a logged-in user.

    Regards.

    Thread Starter blaqshark

    (@blaqshark)

    So i have right now 650 customers i have to put ids one by one.is there any way to make it easy.
    Thanks

    Please read this: https://docs.litespeedtech.com/lscache/lscwp/crawler/#role-simulation
    It may be as bad as you think.

    Thread Starter blaqshark

    (@blaqshark)

    Other plugins make pre-cache easily to logged in users too.there should be another way, like rewrite guest mode and include logged in users too.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    please try add this into your active theme’s functions.php

    function lscwp_nocache() {
    ob_start( function($buffer) {
        @header('X-LiteSpeed-Cache-Control: no-cache');
        return $buffer;
    });
    }
    add_action( 'admin_init', 'lscwp_nocache', 1 );

    then purge all

    this code snippet will force no-cache when admin_init is invoked , which is first action for wp-admin area

    Best regards,

    One issue with that snippet is I’ve seen the wp-admin bar being shown to customers on the frontend

    I’ve also tried this approach but still get cache-miss quite abit

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Serving Public Cache to Logged in Users’ is closed to new replies.