Keyword

com_k2_extended 30.000 FILES!

  • Nick
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 11 months ago #57086 by Nick
com_k2_extended 30.000 FILES! was created by Nick
So my com_k2_extended has 30.000 files cached. WTF?!

What's going on?

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #57087 by william white
Replied by william white on topic Re: com_k2_extended 30.000 FILES!
Nick, what is com_k2_extended? I do not see it in my install.

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago - 12 years 11 months ago #57088 by SDKiller
Replied by SDKiller on topic Re: com_k2_extended 30.000 FILES!
\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
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 11 months ago #57089 by Nick
Replied by Nick on topic Re: com_k2_extended 30.000 FILES!
com_k2_extended is part of the caching system of k2. Not quite sure what it does. I am running K2 with sh404sef and I have 3000 items (exactly lol!)

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.

More
12 years 11 months ago #57090 by Jiliko.net
Replied by Jiliko.net on topic Re: com_k2_extended 30.000 FILES!
Hi,

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
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 11 months ago #57091 by Nick
Replied by Nick on topic Re: com_k2_extended 30.000 FILES!

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.

More
12 years 11 months ago #57092 by Jiliko.net
Replied by Jiliko.net on topic Re: com_k2_extended 30.000 FILES!
Hi Nick,

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
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 11 months ago #57093 by Nick
Replied by Nick on topic Re: com_k2_extended 30.000 FILES!
That will be no problem. I do that all the time. I've got some great customization going on on my site so i'm sure i'll be fine!

Thanks for the tip though :)

Please Log in or Create an account to join the conversation.

  • Nick
  • Nick's Avatar Topic Author
  • Offline
  • Elite Member
More
12 years 11 months ago - 12 years 11 months ago #57094 by Nick
Replied by Nick on topic Re: com_k2_extended 30.000 FILES!
I found this:
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.

More
12 years 11 months ago #57095 by Jiliko.net
Replied by Jiliko.net on topic Re: com_k2_extended 30.000 FILES!
Yes,

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.


Powered by Kunena Forum