- Posts: 190
COMMUNITY FORUM
com_k2_extended 30.000 FILES!
- Nick
-
Topic Author
- Offline
- Elite Member
What's going on?
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
Please Log in or Create an account to join the conversation.
- SDKiller
-
- Offline
- Junior Member
- Posts: 35
\components\com_k2\views\itemlist\view.html.php - Line 267:
$cache = &JFactory::getCache('com_k2_extended');
\components\com_k2\views\itemlist\view.raw.php - Line 258:
$cache = &JFactory::getCache('com_k2_extended');
\components\com_k2\views\latest\view.html.php - Line 22:
$cache = &JFactory::getCache('com_k2_extended');
In v.2.4.1 it was also in Item view
Russian K2 support on joomlaforum.ru
Please Log in or Create an account to join the conversation.
- Nick
-
Topic Author
- Offline
- Elite Member
- Posts: 190
So what should I do about this?
Oh i'm running the latest K2
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
com_k2_extended cache files are used to store item information. There's 1 file per item.
It avoids to query the database each time an item is displayed to load its content.
Notice : This cache is only used when the item content is to be displayed for a guest user. When the user is logged in, the content is always retrieved from the database. This means the cache for a specific content item is refreshed each time a logged in user displays the item content.
Olivier
Please Log in or Create an account to join the conversation.
- Nick
-
Topic Author
- Offline
- Elite Member
- Posts: 190
Olivier Nolbert wrote: Hi,
Notice : This cache is only used when the item content is to be displayed for a guest user. When the user is logged in, the content is always retrieved from the database. This means the cache for a specific content item is refreshed each time a logged in user displays the item content.
Olivier
So THIS explains why I get 200 queries when logged in and 9 when logged out. Is it possible to link the query refresh to a certain user group? For instance just super admins? I visit my own site every day a couple of times but I have a shitton of logged in users... multiply that with 200 queries.. not that good for the server.
Any idea on how I could pull that off? Well I know how I can pull it off, I just need to know where this cache system is located so I can have php check if the user belongs to the super admin group
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
You'll have to hack K2 because the test is implemented in the K2 item list view file (K2 2.5.0) :
'/components/com_k2/views/itemlist/view.html.php' from line #284 to #302
Olivier
Please Log in or Create an account to join the conversation.
- Nick
-
Topic Author
- Offline
- Elite Member
- Posts: 190
Thanks for the tip though :)
Please Log in or Create an account to join the conversation.
- Nick
-
Topic Author
- Offline
- Elite Member
- Posts: 190
if (K2HelperPermissions::canEditItem($items[$i]->created_by, $items[$i]->catid)){
$cacheFlag = false;
}
However from what I understand is that K2 checks if the user can edit the item.. shouldn't that only be the administrators? If so there is nothing to change really...
If that's not the case, should I just pull the user variable from JFactory and check if it's the super admin usergroup?
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
In your case, i think a simple test on the user group is enough...
Olivier
Please Log in or Create an account to join the conversation.