User Cache

When User Cache is activated, WP Rocket creates a dedicated set of cache files for each logged-in WordPress user.

You can enable  User Cache from the Add-ons tab, by switching the "Add-on status" option to "On", like this:

user cache add-on

In WP Rocket versions before 3.16, the  User Cache option can be found in the Cache tab (deprecated).

This is great when you have user-specific content on your website. The site will be cached as normal for any visitor that is not logged in, using one set of cache files, and for each logged-in user using a separate cache.

Logged in user cache is useful when you have a membership site, or similar when users must log in to see content.

User not logged out correctly

If there seems to be confusion about the logged-in or logged-out status of a user, it could be due to the fact that you have custom login or logout pages.

WP Rocket does not cache the default WordPress login/logout URLs. But if you are using custom URLs, WP Rocket will not be aware of them, so you should manually exclude those URLs from the cache:
Exclude pages from the cache

Logged-in content shown to logged-out user and vice versa

Browser caching issues can result in logged-in content being shown to logged-out users or vice versa. To resolve this, install the helper plugin below which modifies the htaccess rules. 

📥   Download (.zip):  WP Rocket | Add custom htaccess rules to set no-store
Developers: You can find the code for this plugin on GitHub.

Custom login cookies

If you use a plugin that sets custom cookies for detecting the logged-in/logged-out status of a user, you may need to add those to the cookie exclusion option in the Advanced Rules tab:

No preloading for User Cache

Preloading does not work for User Cache. Neither one of WP Rocket’s preload processes can “log in” as a specific user to preload individual caches. The preload process will just preload the general cache for visitors as usual.

Cloudflare: Cache Everything

If you have  set up Cloudflare to "cache everything", it does not distinguish between logged in and logged out users and so it can cause unexpected behaviour, such as your WordPress admin toolbar being displayed to all visitors. 

Same cache for all logged-in users

This option is not available from the user interface because it's not commonly used and proved confusing. But if you understand caching and are confident you understand the implications of it for your site, it's possible to use the  same set of cached files for all logged-in users, instead of a set of cache files per user (while still using a separate cache than for normal visitors, of course).

You can still use this feature, just install and activate this helper plugin:

📥  Download (.zip): WP Rocket | Common Cache For Logged-in Users

Developers: You can find the code for this plugin on GitHub.

However, we recommend you thoroughly scrutinize its use as it may result in misplaced content very easily.  

Third party plugin compatibility

The Query Monitor plugin sets the DONOTCACHEPAGE constant to true on pages and prevents the cache when User Cache is activated.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.