Hello @martyshka
Thank you for reaching out.
The general rule is that you should not cache the pages for logged-in users, simply because of the reason you mentioned. Once cached, the pages will show for the next visitor as cached. This may lead to the sharing of some sensitive information.
You cannot have separate cached pages from logged-in users and non-logged-in users. And even if that is available, you should have a separate cache based on the user to avoid sharing some sensitive/account details. This means, more caching, and more server resource consumption. Not to mention that the separate user caching would have to be based on the data that the user provides, and we cannot collect this data due to the GDPR rules.
Just think of a user that is logged in and the information that may be required to collect from the user in order to create a cached file specifically for that user. It needs to be IP-based email-based or some other sensitive information.
No plugin can do this without collecting the user data which is very much against the GDPR.
Also, imagine having 1000 subscribers, and that each subscriber has its own cached files. Multiply that by as an example 100 pages that are created in the cache for each visitor, and cached to disk. Every page needs to have two files cached (regular and gzip). That are 200000 files just for logged-in users.
I hope this explains why this is not a viable option.
W3 Total Cache does have the option to cache pages for logged-in users. This is based on the login/logout status. You can also cache pages or specific user roles that are assigned to the users, like subscribers, editors, etc.
In this case, however, you should also make sure to exclude some pages from the cache, especially the pages that contain sensitive information like /account/, /cart/, /checkout/ etc
Let me know if you have any other questions.
Thanks!