Use LiteSpeed Private Cache on Personalised Pages
Serves pages you choose (such as a dashboard or account page) from LiteSpeed's private per-visitor cache instead of the public one, so personal content is cached safely.
Opens WPIDE on
Code
$wpide_pages = array( 'dashboard', 'my-account' ); // Page slugs or IDs.
add_action( 'template_redirect', function () use ( $wpide_pages ) {
if ( defined( 'LSCWP_V' ) && is_page( $wpide_pages ) ) {
do_action( 'litespeed_control_set_private', 'wpide personalised page' );
}
} );
Notes
List the page slugs or IDs in $wpide_pages.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.