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:
Feature overview
With the User Cache add‑on, WP Rocket creates a separate cache file for every logged‑in user. This allows you to speed up pages that contain user‑specific content, in addition to the pages served to regular visitors.
This feature is especially useful for websites where users must log in to access content, for example, membership sites, e‑learning platforms, or any site that displays customized layouts or account information.
Recommended settings
In general, these are the recommended WP Rocket settings to use when the User Cache add‑on is enabled:
- If you have custom login/logout pages, pages with sensitive information, or pages with dynamic content, please exclude them from the cache.
- Exclude cookies if you use a plugin that sets custom cookies for detecting the logged-in/logged-out status of a user.
- Check the Using membership and community plugins with WP Rocket article if you're managing a membership site.
The settings will vary depending on the specifics of each site. Please perform your own research and verification.
User Cache and other optimizations
In addition to applying the Page caching feature, WP Rocket will also apply some of the additional optimizations, such as Minify CSS files or Delay JavaScript execution.
However, the following features cannot be applied to logged-in users because it's not possible to collect user-specific data:
- Preload cache
- Preload links
- Priority Elements features
- Remove Unused CSS and Load CSS asynchronously
- LazyLoad for CSS background images
Same cache for all logged-in users
If you need it, it's possible to use the same set of cached files for all logged-in users, instead of an individual set of cache files per user (while still using a separate cache than for normal visitors).
To achieve this, please 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.
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.
Known issues
- The Query Monitor plugin sets the DONOTCACHEPAGE constant to true on pages and prevents the cache when User Cache is activated.
- Cloudflare's Cache Everything feature does not distinguish between logged-in and logged-out users so it can cause unexpected behaviour, such as your WordPress admin toolbar being displayed to all visitors.
