Wordpress LScache Plugin: Tag Prefix
Last Updated on: Wed, 15 Apr 2026 00:00:02 We are setting tags, for example: add_action( init, a ) function a( $headers ) LiteSpeed_Cache_API::tag_add( roster ) But to flush it: header( X-LiteSpeed-Purge: tag=9a41_roster,tag=9a4_roster ) Roster doesnt actually work, its always got a prefix. This worked for a few months but now its changed slightly so I had to update it. ? Why is it being prefixed? ? How can I make it flush without having it break down the line and needing to find the new prefix and update the code? This topic was modified 3 years, 8 months ago by rochow. Hi @rochow, We do not recommend to use header for purging cache, please use LiteSpeed_Cache_API::purge($tag), for more details please check: https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:api Thanks, Stanley Hi @stanleylitespeed, The application flushing the cache isnt WordPress. Thats why we need to manually trigger it to flush certain pages on the WP site when other data changes. Is there another method? Thanks, Hi @rochow, Tag Prefix is used for defining the cache for specific WordPress document root, it will not change if the document root remains unchanged. Its generated by the following function: substr( md5( LSCWP_DIR ), -3 ) You can check the const LSCWP_DIR inside your WordPress to be safe. so you may use the same function to retrieve the LiteSpeed Tag Prefix. Thanks, Stanley The tag prefix was changed in 2.9.3 ? FEB 20 2019 changelog, Tag: Only append blog ID to cache tags when site is part of a network. Please make sure the tag you used to purge matched the new tag. In your case, 9a4_ should be it. The timing matches so thatll be it. This site isnt MU btw. I told the client Id post it on the forum to find out because Litespeed support is great and you certainly delivered!
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference