Do you mean that they don’t ever update at all? Or that they don’t 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 don’t update until they visit a page that hasn’t been viewed yet.
@hailite
It’s not using any Wp login they don’t 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 wouldn’t 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.
You’d 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!