Normally, My site has to deny some pages for improper users, my site is allowed 2 kinds of users to register, so I have to deny
custom roles each other, for improper users I have set the layout according to your documentation training, e.g. This page is only for the specific user, if you want to see this page, you must log out...
My question is if I active Rocket cache, the improper user cannot be logged out then. because this page has been cached, when that user goes back to the denied page, will only show up that layout to the user, unless I set the cache plugin as never cache the denied page, but it will cause the logged-in users browse these pages too slow. so I just wanna suggest that you guys may set the remainder layout as a different URL like a uniform random number so that the webmaster can set caching for denied pages, otherwise, once a user logged- in with an improper role, he cannot log out. do you have a better way for this kind of issue in my case? Thank you!
Unfortunately, Toolset provides a cache clearing only for the action of saving or updating Layouts, but not for their display, as this depends entirely on the Page or Post where the Layout is assigned.
Imagine, you would style your entire Post with HTML.
Now, you add conditions to display this or that HTML depending on the condition.
Then, the cache mechanisms kick in and cache the first content, never allowing the conditional content to show.
This is a problem with the cache in that case, and the same in the case of Toolset Layouts.
Layouts just replace the_content() part, hence, it basically just applies it's HTML and other code to the Page or Post.
And that page or post needs to be either free from the cache or flushed, after certain actions.
You could alter the Slug of the Layout to something unique manually since that is what's used to display the layout, it's not related to what's cached afterwards.
Unless I misunderstand the issue, I think the correct solution here is to not cache those specific pages.
You are welcome.
Do you have anything else I can help with - related to the issue?
Otherwise we can close this ticket 🙂
Thank you for the help of this ticket, I just leave a sentence telling the user, please click on the top right on the menu to logout, and removed the logout link on the layout, log-out link on the menu is not cached forever 🙂