Force Cache Pages for Logged In Users?

Discussion regarding Joomla! 2.5 Performance issues.

Moderator: 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.
Locked
redluss
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Aug 05, 2012 12:49 pm

Force Cache Pages for Logged In Users?

Post by redluss » Mon Sep 09, 2013 1:40 pm

Hello All-

I'm working on a website that's a bit different than most - 100% of my users are registered. I need to somehow make the page cache work so that it will cache pages for registered users, which I know is not the normal behavior for Joomla!.

There doesn't appear to be much discussion on this throughout the web. I know what the concerns are with caching pages for registered users, but in this instance, it doesn't matter as they will all see the same content once they're logged in.

Does anyone know if I can hack the cache.php file at /plugins/system/cache/cache.php to force it to just cache everything? On line 62, I see

Code: Select all

if ($user->get('guest') && $_SERVER['REQUEST_METHOD'] == 'GET') {
			$this->_cache->setCaching(true);
and I'm guessing that's what's controlling the behavior. Can I either remove this, or implement a second true statement that specifies registered users? Alternatively, can I just remove the "if" and change the statement to:

Code: Select all

$this->_cache->setCaching(true);
Thanks for any insight or help anyone can provide.

jptkts
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Sun Nov 13, 2005 10:48 pm
Location: Rochest / Buffalo NY
Contact:

Re: Force Cache Pages for Logged In Users?

Post by jptkts » Thu Mar 05, 2015 8:04 pm

I have a similar situation. My users all have to log in, and without cache on pages are loading slow. Did this code work for you? The downside here is that it will need to be added again if you update joomla (as its a core change). However, its hard to believe that more people don't have an issue with this and want module cache for signed in users.

jptkts
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Sun Nov 13, 2005 10:48 pm
Location: Rochest / Buffalo NY
Contact:

Re: Force Cache Pages for Logged In Users?

Post by jptkts » Thu Mar 05, 2015 8:37 pm

Oh, I just realized you changed the code of the system plugin. I just wanted to cache individual modules for signed in users with progressive caching. I doubt you would want to use the system cache plugin for signed in users, as the system cache plugin will cache the entire page (not individual modules). Each user will see a different page so this would never work.

In theory though, progressive module caching caches a version of a module for each unique visitor. However, any cache is disabled when signed in; but if it could be turned on somewhere with a core modification it may work. I'll test it out someday

laxmiram19
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Apr 10, 2018 9:58 am

Re: Force Cache Pages for Logged In Users?

Post by laxmiram19 » Tue Apr 10, 2018 10:04 am

Hi redluss,

I have the same situation now. I need to do a force caching for the Logged In Users based on few conditions.

I have tried by setting "$this->_cache->setCaching(true);" but it is not working.

Can you please share what are the changes required to do to the "Force caching for the Logged In Users".

Thanks in advance


Locked

Return to “Performance - Joomla! 2.5”