• Resolved harryfear

    (@harryfear)


    Hi team,

    Thanks for an amazing plugin.

    What is the intended behaviour with custom post types? When they are created, edited, auto-saved, deleted, etc., is Litespeed by default doing a purge of any kind?

    I don’t see any options under Cache > Purge to do a purge when Posts are published or when Custom Post Types are published. What I see are options that pertain to pages and archive pages for posts. https://ibb.co/sPD2Zm4

    The options suggest that when a post is published, no purge is completed.

    Regarding custom post types, let’s take for example Boxzilla popups. Their custom post type is boxzilla-box. When I update a Boxzilla popup, I don’t see Litespeed perform a cache by default. The same when I create a new Boxzilla popup. Is this intended behaviour?

    I came up with a plugin that manually hooks into the Boxzilla edits and purges LS, but this seems odd to have to resort to this?

        function do_purge() {
            //do_action('purge_all');
            if ( defined( 'LSCWP_V' ) ) {
                do_action( 'litespeed_purge_all' ); // Purge the LiteSpeed cache
            }
        }
    
        // Add support for Boxilla CPT edits purging cache
        add_action( 'save_post_boxzilla-box', 'do_purge' ); 

    I guess I could have just added “save_post_boxzilla-box” to the list of “Purge All Hooks”.

    But either way, is it right that Litespeed doesn’t automatically purge when CPTs are modified? Isn’t this a normal use case that Litespeed would want/need to purge for?

    Thanks.

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

    (@qtwrk)

    Hi,

    Is this intended behaviour?

    is it right that Litespeed doesn’t automatically purge when CPTs are modified?

    yes , it’s not exactly as intended , but it’s default behavior

    because when you do something that changes page content , you need to let LSCWP know about it thus to purge it

    for default WP built-in post type, we have detection for auto-purge , but for custom post type , as you can imagine , there could be millions different of them , there is no way for us to get them all

    this seems odd to have to resort to this?

    well , not entirely , if it’s not natively supported , we have to do it this way

    Best regards,

    Thread Starter harryfear

    (@harryfear)

    Thanksm, @qtwrk! What is “auto-purge” and how can we inform other plugin developers to support this?

    Thanks.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    auto-purge is just like automatically purge when you edit/publish a post

    you can ask other plugin dev to add

            if ( defined( 'LSCWP_V' ) ) {
                do_action( 'litespeed_purge_all' ); // Purge the LiteSpeed cache
            }

    on their saving action

    Best regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Purging behaviour with CPTs’ is closed to new replies.