• Resolved asafm7

    (@asafm7)


    Hello.

    Is there a way to make do_action( 'litespeed_purge_url', 'the_url' ) take immediate effect when used in cron?

    Thanks.

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

    (@qtwrk)

    please explain a bit what exactly do you want to do here ?

    Thread Starter asafm7

    (@asafm7)

    On certain cases, I want to set a cron to purge a URL and then immediately visit the URL using wp_remote_get() to re-cache it.

    do_action( 'litespeed_purge_url', 'the_url' ) is delayed, and so it is hard to effectively achieve it.

    Plugin Support qtwrk

    (@qtwrk)

    you need to trigger the wp cron use wget/curl way , use command line will be delayed

    Thread Starter asafm7

    (@asafm7)

    The cron is triggered (via cPanel). Are you saying I need to use curl inside the cron script?

    Plugin Support qtwrk

    (@qtwrk)

    what was your cron command ?

    Thread Starter asafm7

    (@asafm7)

    A standard command for triggering wp-cron.php:

    cd /home/public_html && /usr/local/bin/php /home/public_html/wp-cron.php

    Plugin Support qtwrk

    (@qtwrk)

    yeah , that’s what I mean , you need to use wget/curl way to trigger it to get immediate purge

    wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
    Thread Starter asafm7

    (@asafm7)

    Thank you.

    I tried using the command you sent but got the same result. Using do_action( 'litespeed_purge_url', 'the_url' ), the URL isn’t being purged immediately, only on the next visit.

    do_action('litespeed_purge_all') on the other hand, seems to have an immediate effect.

    Plugin Support qtwrk

    (@qtwrk)

    that makes no sense

    please try grab the plugin’s debug log , see what happens during that action.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Immediate URL purge in cron’ is closed to new replies.