Repository navigation
Logged in page cache
By default only guests get cached pages. Anyone signed in gets a live render on every page view.
On a membership site, a shop with accounts, or a newsroom where the whole team browses the front end signed in, that is a lot of full renders for pages that look almost the same for everyone. The logged-in page cache lets signed-in visitors share a stored copy.
It is off by default. Turn it on under Caching > Serve cached pages to logged-in users.
A signed-in page differs from a guest page in a few known places. Each is handled:
| What differs | How it is handled |
|---|---|
| The toolbar: name, avatar, profile link, log-out link | Cut out of the stored copy and rendered fresh for each visitor |
| Security tokens: the REST token, form tokens, log-out links | Each is replaced by a placeholder in the stored copy. On a hit the viewer's own token is put back. |
| What the user may do: edit links, role-only blocks | The copy is keyed by group, and everyone in a group can do the same things |
| Anything else that names the user | The page is not stored at all |
Guests and signed-in visitors never share a copy. The guest key is unchanged.
| Group | Who | Setting |
|---|---|---|
| Administrators | Users who can manage the site | on |
| Editors | Users who can edit everyone's posts | on |
| Readers | Users who cannot edit anything: subscribers, members | on |
| Customers | WooCommerce customers | off, on the WooCommerce tab |
Authors and contributors are never served a stored copy. They see edit links for their own posts only, so no copy would be right for all of them.
Change which group a user lands in, or keep someone out, with the aceredis_logged_in_cache_group filter.
A signed-in response that contains the viewer's own details is refused. The reason is sent in the X-AceRedisCache-Skip header:
| Reason | Meaning |
|---|---|
li_user_email |
The page contains the viewer's email address |
li_comment_form |
The page has a comment form's "Logged in as" line |
li_toolbar_left |
The toolbar could not be cut out of the page |
If your theme or plugin prints something personal on the page, tell the plugin by returning a reason of your own:
add_filter( 'aceredis_logged_in_store_block', function ( $reason, $html, $user ) {
if ( null === $reason && false !== strpos( $html, 'class="member-greeting"' ) ) {
return 'member_greeting';
}
return $reason;
}, 10, 3 );Better still, make the personal part a live block, so the rest of the page can be cached.
- Previews and the Customizer
-
POSTrequests ?aceredis_nocache=1- Basket, checkout and account pages
- Anyone with something in their basket
A signed-in copy is only ever served while it is fresh. Stale copies are not served to signed-in visitors. A purge drops every variant of a page along with the guest copy.
Signed in, load a front-end page twice. The response carries the group:
X-AceRedisCache: HIT
X-AceRedisCache-Variant: li-editor-ab
The early-serve drop-in never serves signed-in visitors. Their hits are served by the plugin after WordPress loads, because the toolbar and security tokens need WordPress.
Turn it on when signed-in visitors mostly read: members, subscribers, staff browsing the site.
Leave it off when pages carry prices, stock or content that differ per user rather than per role, unless those parts are live blocks. For shops, read the note on customer pages in WooCommerce first.
Separate from the page cache: by default a signed-in front-end request reads the shared object cache, and never writes to it. Without that, a page that costs a guest twenty queries can cost a member several hundred, because everything guests already cached is read from the database again. See Object cache.
Ace Redis Cache: a page cache and object cache for WordPress, backed by Redis or Valkey. Written and maintained by Shane Rounce at AceMedia. Website · Repository · Issues · GPLv2 or later
Setting up
The caches
Your stack
Reference
Help
