Advertisement

caching off for logged-in user

For Joomla! 5.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
kafco
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Feb 10, 2025 11:15 pm

caching off for logged-in user

Post by kafco » Mon Feb 10, 2025 11:20 pm

Hello,
I am a developer working on a module for Joomla 5.

I have set Joomla’s cache to "ON - Conservative caching", and the module's cache is set to "Global".

When a guest user visits the site, Joomla caches the entire module, and everything works fine.
However, when a logged-in user accesses the site, Joomla no longer caches the module and calls tmpl.php on every request.

I checked the Joomla core file:
Path: libraries/src/Helper/ModuleHelper.php
Line: 591

Code: Select all

if ($ownCacheDisabled || $cacheDisabled || $app->get('caching') == 0 || $user->id) {
     $cache->setCaching(false);
}
How can I make Joomla cache my module even for logged-in users?
I need my module to be cached under all conditions.

Note:
I don’t want to use Joomla's Page Cache Plugin because it caches the entire page.
I only want this specific module to be cached, not the whole page.
thank you

Advertisement
Advertisement
Post Reply

Return to “Joomla! 5.x Coding”