Purging behaviour with CPTs
-
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.
- The topic ‘Purging behaviour with CPTs’ is closed to new replies.