• Hi there,

    Are there any action fired when URL’s are purged? And also what URL’s that was purged?

    Best Regards,
    Peter

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

    (@qtwrk)

    could you please explain a bit what exactly is it you want to do ? so I can better help you with

    Thread Starter pstidsen

    (@pstidsen)

    Hi @qtwrk

    My host does not allow the default crawler to be active (due to resource limitations). Instead, they suggest to only crawl popular products and pages. I have made a crawler that checks the popularity of a given post (there’s a post meta field with a number) and crawl if it is popular. When the crawler has crawled a post, a post meta field (“last_crawled”) is added with a timestamp.

    However, when a post is purged, it is not rechecked by the crawler due to the “last_crawled” meta field (my custom crawler only checks once a week at the moment). My idea is to delete the last_crawled meta field when a post is purged in order to check/crawl it on the next run.

    Is that somehow possible?

    Best Regards,
    Peter

    Plugin Support litetim

    (@litetim)

    @pstidsen hello
    I see where you want to get.
    Did you tried: action edit_post and delete the meta every time post is updated?

    Thread Starter pstidsen

    (@pstidsen)

    Thanks for your reply.

    Yes, I can remove the meta on edit_post. However, purge is also happening when stock status changes. And sometimes the purging rules says that other pages should be purged because of edit, stock changes etc. And when the menu is changed, everything is purged so that should delete all meta keys..

    So my thought was to hook into the actual purge action instead just imitating the purging rules.

    Best Regards,
    Peter

    Plugin Support litetim

    (@litetim)

    Stock changes see actions:
    woocommerce_product_set_stock
    woocommerce_variation_set_stock

    Plugin Support litetim

    (@litetim)

    We do not have actions/filters on all the purge functions.
    We will look into adding more actions/filters but for now you can hook into the same hooks as LSC does.

    Thread Starter pstidsen

    (@pstidsen)

    I see. It could be awesome if the purge function ended with something like:

    do_action('after_purge', $urls);

    Where $urls was a list of URL’s purged.

    Thread Starter pstidsen

    (@pstidsen)

    I have looked into the litespeed plugin code. Is the litespeed_purge_post action doing what I want to?

    Plugin Support litetim

    (@litetim)

    Yes, should be ok

    Thread Starter pstidsen

    (@pstidsen)

    The litespeed_purge_post?is correctly fired when a product e.g. is running out of stock. However, other things can happen due to purge. What else should I hook into?

    Plugin Support litetim

    (@litetim)

    @pstidsen great news ??
    Starting from version 7 there will be some actions added to the plugin on the purge functionality.

    Thread Starter pstidsen

    (@pstidsen)

    Hi @litetim

    Interesting! Are there any ETA for version 7?

    / Peter

    Plugin Support litetim

    (@litetim)

    December sometime ??

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