Wordpress LScache Plugin: File ? Cache Management
Last Updated on: Wed, 15 Apr 2026 00:00:02 I have a website that uses an API to login users. When the user is logged in the header links update. But with this plugin, they dont update. I use this plugin for all our clients and was wondering if there is a way to disable the cache for a specific file. Header.php for example. Or Can I trigger a flush when the user is logged in, for example, call a function in my functions.php file? This topic was modified 4 years, 2 months ago by Nathaniel Meyer. Do you mean that they dont ever update at all? Or that they dont update until the newly-logged-in user visits another page? Our plugin has a hook to wp login process action set_logged_in_cookie in inc/vary.class.php, to set a cookie which can make the logged-in users get a separate cache than guest visitors. If your API honors that hook, it will set that cookie. Are you using any other ways to login? @lclarke They dont update until they visit a page that hasnt been viewed yet. @hailite Its not using any Wp login they dont have an account for WordPress the account is stored off-site and validated in functions.php. Is there a function to trigger a flush from functions.php. Hi, @beansandrice Yes, there is a function to trigger a flush available in our API, but I wouldnt recommend that approach. The best way to handle this, I think, is for you to have separate cached copies of the page: one for logged-in users, and one for non-logged-in users. If you can set a cookie to distinguish who is a logged-in user, then LSCache can be configured to create a cache vary on that cookie. Youd need to add a line to your .htaccess like this, where api-login-cookie is the name of the cookie used by the plugin: RewriteRule . - [E=cache-vary:api-login-cookie ] We discussed a similar situation in this post recently. And this wiki goes into some detail about how it works. Let us know if you have any questions!
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference