Feature request: allow SP Page Builder pages to be cached for logged-in users (per access level) - Forum | JoomShaper
Staff replied SP Page Builder Joomla 5 v6.9.1

Feature request: allow SP Page Builder pages to be cached for logged-in users (per access level)

Asked by HalTurner 1 day ago Last activity 14 hours ago

Environment

  • SP Page Builder Pro 6.9.1
  • Joomla 5.4.9 with conservative caching enabled
  • Membership / news site where most visitors at peak times are logged-in members

Current behaviour

In components/com_sppagebuilder/controller.php, display() marks the page view as cacheable, but then turns caching off for any logged-in user:

  • $cachable = true for the page view, then
  • if ($user->get('id') || $isIgnoreView) { $cachable = false; }

So guests get Joomla's view cache, but every logged-in member's page view rebuilds the whole SP Page Builder page from scratch, including every Articles block and every database query behind it.

On our site, a live show starts at a fixed time and ~1,000 members log in within a few minutes, most of them landing on the homepage. Each member homepage view rebuilds the same page, with the same article lists, for every member. That repeated work has been the main cause of our database overloads at peak time. Before we doubled our database server, it reached 96–97% CPU.

Why caching for members is usually safe

Joomla's view cache stores the component output only. Template modules (for example a login box or a "Hello, <name>" module in a template position) are rendered separately on every request, which is exactly why the guest cache works today without breaking login forms. The SP Page Builder page body itself is typically identical for all members with the same access levels.

Requested feature

  1. A per-page option, e.g. "Cache this page for logged-in users" (default No, so nothing changes for existing sites), and/or a global option in the component settings.
  2. When enabled, cache the page output per set of view access levels + language, so members with the same access see one shared cached copy, and different access levels never see each other's content. Joomla's cache API already supports keying by view levels.
  3. Safety rules:
    • Skip caching automatically when the page contains addons that output per-user content or CSRF tokens (e.g. a login addon, a form builder with tokens, user-specific dynamic content), or let those addons declare themselves "not cacheable".
    • Clear the cache for a page when it is saved in the editor (and, for Articles blocks, when an article is saved, as Joomla already does for its own article modules).
  4. Optional: a short configurable cache time per page (e.g. 1–5 minutes) for news homepages that change often.

Impact

For sites with many logged-in users, this would turn N identical page builds per cache period into one, and would be the single biggest performance improvement SP Page Builder could offer membership, community and news sites. Default off means zero risk for existing installations.

3 replies

Mehtaz Afsana Borsha Staff

Hi,

Thank you for the detailed explanation and for sharing your findings.

We understand your concern about the performance impact of rebuilding identical SP Page Builder pages for logged-in users, especially during peak traffic.

Your suggestion to introduce optional caching for logged-in users, with access-level separation, automatic exclusions for user-specific content, and cache invalidation, is valuable.

However, caching authenticated page content requires careful handling to prevent personalized information, session-specific data, or security tokens from being shared between users.

We will forward your feature request to our development team for review and consideration in future updates. We cannot confirm an implementation timeline at this stage.

Thank you for taking the time to explain the issue and propose a possible solution.

Best regards.

HalTurner Asked this

Thank you for forwarding this. I agree that tokens and personal data must never be shared between users.

A smaller first step might avoid that concern entirely: cache only the Articles addon's article list, not the page. On our site almost all of the repeated work at peak time is the Articles addon fetching the same article
lists for every member. Caching just that data (the list of articles for a given addon configuration, keyed by view access levels + language, for a few minutes, cleared when an article is saved) contains no HTML, no tokens
and nothing user-specific. The page itself would still be built for every user. This is also the "result caching per view levels" part of our separate Articles addon report.

Mehtaz Afsana Borsha Staff

Hi,

Thank you for the clarification and suggestion. Caching only the Articles addon's results seems like a reasonable approach to improving performance while minimizing security concerns.

I'll forward these additional details to our development team for further review and consideration.

We appreciate your valuable feedback and understanding.

Log in to reply.