• Resolved acsnaterse

    (@acsnaterse)


    Hi there,

    When using the “purge cache” actions from the plugin, they seem to to be reflected in the frontend at all. Not on page or template (ie. flush homepage after publishing a post) level, but even not on “purge all” level.

    The cache only seems to be flushed, when we manually remove the “lscache” folder from the document root (so, not part of the webroot or wp-content folder). But as you can imagine, this is not a desirable situation, and also impossible to purge caches on page or template level.

    What could be the cause for this issue?

    Maybe important information about our server setup: the webroot is not a “hard” folder, but a symlink to the last deploy folder in our “releases” folder (we use Deployer for deployments). Not sure if this could cause any issues with this plugin?

    Thanks in advance!

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Support qtwrk

    (@qtwrk)

    please provide the report number , you can get it in toolbox -> report -> click “send to LiteSpeed”

    Thread Starter acsnaterse

    (@acsnaterse)

    Thanks! This is: YXXKGFOP

    Plugin Support qtwrk

    (@qtwrk)

    you have cloudflare page cache , our plugin will not be able to purge CF page cache

    Thread Starter acsnaterse

    (@acsnaterse)

    Yes, we also have an extra layer of CF cache, but we tested it without and the issue remains. Also after clearing the CF cache, issue remains and still see the cached Litespeed version of a purged page (purged via WP).

    Plugin Support qtwrk

    (@qtwrk)

    please check what is the value of x-litespeed-cache response header before and after purge

    Thread Starter acsnaterse

    (@acsnaterse)

    I’ve checked them, please see CURL answers below (with the “connect-to” option we bypass the CF server and post directly to the server):

    See the screenshot for results before and after purge. We can;t see any difference, and still the “hit” is being served.

    Screenshot: https://radishconcepts.d.pr/i/dJnZqT

    Plugin Support qtwrk

    (@qtwrk)

    what does it show if you run

    curl -XGET -I --resolve vpnoverview.com:443:45.82.191.23 https://vpnoverview.com/?test123
    # run above twice , make sure you see cache: hit first
    
    curl -XPURGE -I --resolve vpnoverview.com:443:45.82.191.23 https://vpnoverview.com/?test123
    
    curl -XGET -I --resolve vpnoverview.com:443:45.82.191.23 https://vpnoverview.com/?test123

    on server SSH ?

    Thread Starter acsnaterse

    (@acsnaterse)

    Strangely enough I only get “misses” when testing this, see https://radishconcepts.d.pr/i/icccTV.
    When testing on a regular page, I do see the “miss” after the PURGE, but also here the “miss” stays there (but I don’t think that is the issue here 🙂 ), see screenshot: https://radishconcepts.d.pr/i/PmD4ev

    But let me also aks these questions:

    First question:
    When using the “purge this page”, I think the plugin should reload the page with the XPURGE header, right. However, when doing so, I can’t find this header in the request headers. How can I test/reproduce this?

    Second question:
    How does this exactly works for purge actions, fired by admin-actions (like saving a post) ? Is this stored in the database and picked up with a cron to purge? Or how does this part work?

    Maybe we can debug it via this route?

    Plugin Support qtwrk

    (@qtwrk)

    Q1 ) , well no , plugin does it in different way

    please try this

    do the curl as above again , with -XGET -I argument , to any page , make sure you see cache hit

    then create a php file with code as below

    <?php
    header('x-litespeed-purge: /your_page_uri_from_curl_command');

    access it by browser, then try curl again , see if it’s hit or miss

    Q2) it should fire the header x-litespeed-purge immediately , unless the purge is called/initiated by WP CLI , in that case, it will be stored in DB until next time the PHP is triggered by webserver

    Thread Starter acsnaterse

    (@acsnaterse)

    Yep, that method seems to work..

    However, we don’t see this purge behaviour via the CMS. Is there a way we can debug that the correct x-litespeed-purge headers are send?

    • This reply was modified 1 year, 8 months ago by acsnaterse.
    Plugin Support qtwrk

    (@qtwrk)

    hmm, the most reliable way is to check server debug log , it will log the header it receives or sends , but this may require the root access to server

    let’s try this

    same steps , but change PHP code to

    <?php
    require( './wp-load.php' );
    if ( defined('LSCWP_V')) {
    do_action( 'litespeed_purge_url', '/yourpageurl/' );
    echo 'done';
    }
    Thread Starter acsnaterse

    (@acsnaterse)

    Yep, that seems to work as well. After doing this we see the following header from the curl result for this URL:

    x-litespeed-cache-control: no-cache

    Plugin Support qtwrk

    (@qtwrk)

    that sometime happens since curl command is not fully mimicking the browser header , you can try that with real browser for the -I -XGET part though

    Thread Starter acsnaterse

    (@acsnaterse)

    Yep, I see.. But that seems to work..

    After purging via the do_action, I can see that the first next load is a miss in the litespeed header. The second after is a hit

    So, that mechanism seems to work. What would be the best way to find out why this works, and it does not seem to work via the regular wp-admin actions?

    Thread Starter acsnaterse

    (@acsnaterse)

    Hi there,

    We did some additional research here, which might help.

    FYI: we’ve disabled Cloudflare during these tests, so that should not be part of the issue.

    Scenario’s:
    – “Purge this page” seems to work. Was a bit hard to test via CURL, but just seems to work (ie we see a “miss” on the Litespeed cache header for the next request)
    – Via the Toolbox “Purge all pages” seems to work
    – Via the toolbox “Purge frontpage” does not work (tested it several times)
    – Updating a post: does not purges the homepage and/or category pages, unlike the setting for it (https://radishconcepts.d.pr/i/2taX6X). It does purge the post itself

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Purge cache commands seems not to be reflected’ is closed to new replies.