Slow Time to First Byte (TTFB) when users are logged in: find and fix the cause

Logged-in visitors and shoppers with a cart can get a much slower first byte than new visitors. They skip the page cache, so the server builds each page.

Arjen KarelArjen KarelUpdated November 27, 2026

Why is my site slow for logged-in users?

In short

  • A page cache serves visitors without a session a stored copy of each page. With a login or cart cookie, their requests skip that cache, so your server builds every page and the first byte arrives later.
  • Compare logged-in and logged-out visits on the same URL, and look first at how long your server takes to answer.
  • Load small personal parts like a cart badge after the page, turn on an object cache for pages that must stay personal, and keep personal HTML out of a shared cache with Cache-Control: private.

Time to First Byte (TTFB) is the wait for the first byte of the HTML, and nothing paints before it. It is good at 0.8 seconds or less and poor over 1.8 seconds (web.dev).

A membership site where everyone is logged in, or a shop where most visitors have a cart, gets little out of a page cache. I have seen logged-in WooCommerce shoppers wait 5 to 9 seconds for a page that opens within a second for anonymous visitors.

How much slower is the first byte after login?

Logged-in visitors had a pooled TTFB of 1.20 s at p75 on full page loads against 0.69 s for logged-out visitors, across all CoreDash projects from 25 October to 21 November 2026. They waited longer on 69% of sites: the median site was 1.22× slower (+246 ms), the slowest quarter 2.35× or more.

Part of that gap is page mix: only logged-in visitors open their account and order pages. On the same URL, logged-in page loads were still slower on 63% of URLs, with a median gap of 1.16× (+119 ms). Even on one URL these are two groups of visitors, and that is a correlation: logged-in people also use other devices and more often have an open connection.

PageSpeed Insights' lab test is a default Lighthouse run: it loads a public URL as a new visitor without a session, so it measures the page a logged-out visitor gets. Its field data from CrUX mixes in logged-in Chrome visits.

Are visitors with items in their cart slower too?

Visitors with a cart are slower only where a cart cookie bypasses the page cache. Default WooCommerce sets woocommerce_items_in_cart and wp_woocommerce_session_ as soon as something goes in the cart. Cloudflare APO always bypasses the page cache on woocommerce_ cookies (Cloudflare APO), and WooCommerce says you can exclude them from caching (WooCommerce caching docs). Adobe Commerce serves catalog HTML from the shared page cache to shoppers with a cart too, and keeps their cart sections in localStorage (Adobe Commerce docs).

Which part of TTFB grows for logged-in visitors?

The extra wait for logged-in visitors is almost all in Request, the last of the five TTFB sub-phases: your server or CDN building the HTML, plus the network trip until the first byte arrives. Across all CoreDash projects, Request at p75 was 910 ms logged in against 437 ms logged out, and it had the largest gap on 71% of sites.

p75Logged inLogged out
TTFB1,202 ms690 ms
Waiting + Redirect68 ms25 ms
Worker & Cache2 ms2 ms
DNS0 ms3 ms
Connection0 ms45 ms
Request910 ms437 ms

Per sub-phase at p75, across all CoreDash projects, 25 October to 21 November 2026. The rows are separate p75 values and don't sum to TTFB.

On the same URL, Request was 70 ms higher at p75 on the median URL. For making the server faster, see breaking down and speeding up request duration on corewebvitals.io.

DNS and Connection are 0 ms at p75 logged in: those visits more often reuse an open connection, and Navigation Timing then records both as 0 ms (MDN). Waiting + Redirect holds redirects such as ad and tracking links; see slow TTFB on Google Ads landings.

How do you compare logged-in and logged-out visitors on the same pages?

On the Time to First Byte page in CoreDash, click "Add filter", open "All dimensions" and pick "Logged in" or "Cart status" ("Empty cart", "Has items", and "Just added" for a tab's first page view to find items, even on return visits). Add "Navigation type" set to "Page load" so you compare full page loads, and read the "Sub-phases" card: is Request, the server's part, over its 500 ms good line while the other four stay small? Then switch the "Pages" table under the card to "URL" and compare one page at a time, so account and checkout pages don't skew the result.

The TTFB page filtered to "Logged in": the "Sub-phases" card shows which part grows.

For the groups side by side, open Explore and, in the metric picker, pick "Time to First Byte" and Request (under "TTFB sub-phases"). Uncheck LCP, then set "Group by" to "Logged in" or "Cart status" under "More". A "URL" or "Page label" filter keeps every row on the same page or template. Pick a period that starts in the last 56 days, or these groupings are off.

Explore grouped by "Logged in": the three groups next to each other.

CoreDash also checks this gap and opens a "Logged-in visitors slower" issue, titled "TTFB <value> at p75 for logged in visitors". It opens when TTFB at p75 for "Logged in" or "Admin" visits is over 800 ms and at least 1.5× logged-out TTFB, per device, and a statistical test is certain of the gap; nothing opens under 20 page views. While a site has less than 7 days of data, a gap the test can't confirm yet shows as "Low confidence". "Open the TTFB page with these page views" and "Open in Explore" on the issue open that group and device. The check pools all URLs on a device, so compare one URL in both groups next. No check looks at "Cart status", so group by it in Explore.

A "Logged-in visitors slower" issue: one device, last 7 days.

How does CoreDash detect logged-in and cart visits?

CoreDash's tracker sets "Logged in" when it sees WordPress's logged-in body class or wordpress_logged_in_ cookie, a readable logged_in, auth_token, session_id or user_id cookie, or a userId, user_id or isLoggedIn field in Google Tag Manager's dataLayer. The CoreDash WordPress plugin also sets "Admin" when auto-tagging is on. A site that gives every anonymous visitor a readable session_id or user_id cookie counts everyone as "Logged in"; an app that keeps its session only in an HttpOnly cookie counts everyone as "Logged out".

For "Cart status", the tracker reads the cart of Shopify, WooCommerce, Magento and BigCommerce, and otherwise looks in the dataLayer for an add_to_cart event or a filled ecommerce.items list. GA4's standard view_item and view_item_list events fill that list too, on product and category pages, so a site with GA4 ecommerce can show empty carts as "Just added" and "Has items". Before you act on either split, check its page views in Explore against your real login and cart rates.

When either guess is wrong for your site, set __CWVLI and __CWVCART to the visitor's real state on each page before the tracker runs: 0, 1 or 2, where 2 is "Admin" for the login and 1 is "Just added" for the cart.

window.__CWVLI = isLoggedIn ? 1 : 0; window.__CWVCART = cartCount > 0 ? 2 : 0;

What do you change to speed up logged-in and cart TTFB?

Public catalog and article URLs should come from the page cache, with the personal parts loaded after the page. Account, cart and checkout pages stay personal, so the fix there is an object cache and less server work per request.

Session and cart cookies that bypass the cache on public pages

When a catalog or article URL puts a cart count or a greeting in the HTML, or a cookie rule is too broad, every click after that skips the page cache. In Cloudflare Cache Rules or your caching plugin, make sure analytics cookies never bypass the cache, and keep Cart, Checkout and My Account excluded (WooCommerce caching docs). Then ask your developer to load the greeting and cart badge after the page opens, so the shared HTML stays cacheable.

A CDN rule set to "Cache Everything" with no cookie condition, or WP Rocket's optional helper that shares one cache across logged-in users, looks like the obvious fix. That stores the first visitor's HTML in the shared cache and serves their name, WordPress admin toolbar or cart to the next visitor (Cloudflare caution, WP Rocket docs). Any response that still holds personal data must never enter a shared cache, so keep the cache bypass on your session and cart cookies.

A shared cache can store a response even when it carries a Set-Cookie header (RFC 9111), so set Cache-Control yourself: private, no-cache on every personal page and fragment, and no-store on checkout and account pages (MDN):

Cache-Control: private, no-cache
Cache-Control: no-store

For loading the cart in the browser and edge fragments, see caching pages for logged-in and cart visitors on corewebvitals.io.

Logged-in toolbars, member widgets and per-user caches

Code that only runs for logged-in users adds server work to every uncached request. WooCommerce already hides the front-end toolbar for customers. Plain WordPress and membership sites still build it for subscribers: untick "Show Toolbar when viewing site" on member profiles, and turn off front-end member bars you don't need in your membership or learning plugin.

In a theme's functions.php, turn the front-end toolbar off for everyone who isn't an administrator (WordPress reference):

if ( ! current_user_can( 'manage_options' ) ) { show_admin_bar( false ); }

Per-user page caches (the "User Cache" setting in WP Rocket, "Cache Logged-in Users" in LiteSpeed Cache) store a private copy for each user (WP Rocket, LiteSpeed), so they pay off where members reopen the same pages; every user's first visit still waits on the server.

Repeated database queries and slow server code on personal pages

Without a persistent object cache, WordPress fetches options, user metadata and permissions from MySQL again on every page load. Look in Site Health for "You should use a persistent object cache". Turn on Redis or Memcached in your hosting panel (or ask your host), then switch on your host's object cache or the Redis Object Cache plugin, which installs wp-content/object-cache.php (WordPress object caching docs).

A page cache can also hide slow plugins while visitors browse anonymously. Once a login or cart cookie bypasses the cache, role-based pricing rules, membership checks, live carrier rate calls and old themes that fire wc-ajax=get_refreshed_fragments all run on your PHP workers. On WooCommerce, swap the legacy Mini-Cart Widget for the Mini-Cart Block, which updates without wc-cart-fragments (WooCommerce developer blog), or turn off cart fragments you don't need in Perfmatters or FlyingPress. Send your developer the slowest URL from the "URL" tab in CoreDash. A Server-Timing header (sent only to logged-in staff, if you like) shows in DevTools whether the database or the application code holds up the response:

Server-Timing: db;desc="Database";dur=121.3, app;desc="Application";dur=212.2

For slow server code, see reducing request duration and finding a slow WordPress backend on corewebvitals.io.

Did the fix work?

The fix worked when Request and TTFB for "Logged in" come close to "Logged out", and "Has items" to "Empty cart", on the same URL in Explore a week after the change goes live, with traffic and page mix steady. On the "Logged-in visitors slower" issue, click "Fix applied": from the next day its runs count only page views after the fix, and it closes as "Fixed" or opens again once they make it certain. Verifying a Core Web Vitals fix covers the before and after.

The CoreDash reference lists both dimensions: "Logged in" and "Cart status".

Track your first site free.No card needed. Setup takes about 5 minutes.

Start free trialBook a demo