Tagged: Page Cache
-
AuthorPosts
-
January 26, 2024 at 8:32 am #123394Emiliano GonzalezGuest
Hello,
We are using the free version of the W3 Total Cache plugin. We wanted to know if the Pro version includes a configuration to allow us to cache a few pages. Now, we have the cache only enabled to NOT logged-in users. But, we want to cache a few pages (URLs), it always doesn’t matter if the user is logged in.
Is that possible?
Thanks
January 26, 2024 at 8:36 am #123639Marko VasiljevicKeymasterHello Emiliano,
Thank you for reaching out and I am happy to help!
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.
However, W3 Total Cache is an advanced plugin for a reason, and you can achieve what you need, but this means some specific configuration.
As a guideline, you should disable caching for logged-in users and only allow caching for subscribers/customers (If this is the user role). Next, Browser Caching is a big NO in this case, so you should modify the Browser Cache for the HTML and set the expires headers to not cache and no-store. This will also impact non-logged-in users.
And of course, any pages with sensitive information like checkout, cart, or account should be excluded from the cache.
The login/logout is also something that should remain dynamic, so this depends on the plugin you are using for this. and you can use Page Fragment Caching, and wrap the PHP code for the login/logout with the mfunc to exclude that part of the page from being cached. Alternatively, you may use AJAX call for login/logout.to direct your question directly, There is no way to only cache a couple of pages for logged in users. There is no option to add pages to cache only to exclude them from being cached.
I hope I explained this and let me know if you have any other questions.
Thanks!
- This reply was modified 8 months, 3 weeks ago by Marko Vasiljevic.
-
AuthorPosts
- The topic ‘Page Cache to Logged in Users’ is closed to new replies.