Author Topic: Category Cache Problem VM 3.0.8  (Read 20346 times)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4680
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Category Cache Problem VM 3.0.8
« Reply #15 on: June 30, 2015, 17:12:28 pm »
Hi,
I see all day this cache problem, Why the team does not try to add my solution or another one?

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3751
  • using Matomo instead of Google Analytics
Re: Category Cache Problem VM 3.0.8
« Reply #16 on: June 30, 2015, 22:23:54 pm »
I see all day this cache problem, Why the team does not try to add my solution or another one?
Is it still a problem? I found only this forum thread about a possible category cache problem. In the case above (original post from April) it might also be related to a GK framework cache, which could still be active after changing the frontend template. With my installed templates, I couldn't reproduce the issue.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4680
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Category Cache Problem VM 3.0.8
« Reply #17 on: July 01, 2015, 00:10:29 am »
Hi jjk, the problem is only that the cache get not refreshed when you save the category(and manufacturer)
This mean for eg, the link(alias) to a category can be wrong the time the cache is not expired or you clear the cache in Joomla.
This is not a so big problem, but this make trouble for some users.
I had report in virtuemart french forum, here in forum, by PM(to get a solution), in some other sites.

franzpeter

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 467
    • 2in1-online | Software, Mac, PC, Netzwerk, Drucker, Pad, Display
  • VirtueMart Version: Virtuemart 3.2.6
Re: Category Cache Problem VM 3.0.8
« Reply #18 on: July 01, 2015, 11:16:26 am »
My opinion is: VM should not do any forced cache. Joomla allows to switch on or off the cache inside the configuration tab. If switched off, no cache should occur. If someone wants to use cache for categories it should be customers decision.

Mayapi

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: Category Cache Problem VM 3.0.8
« Reply #19 on: February 18, 2016, 00:00:08 am »
Hello friends from France,

i have also a problem with the cache of Virtuemart 3.0.12 ...

The "search in the shop" module and the "filter by price" module run normally when i have clean the "com_virtuemart_cats" into the purge cache of joomla 3.4.8, but after i refresh the page the "com_virtuemart_cats" reappear each time and i lose the functionnality of the two module. They find nothing, simply seams very stuck due to cache.

I have check all modules cache and plugin page cache to NO.

My question is: How is it posssible to remove the cache system of the "com_virtuemart_cats" ?


Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4680
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Category Cache Problem VM 3.0.8
« Reply #20 on: February 18, 2016, 02:00:18 am »
Hello friends from France,

i have also a problem with the cache of Virtuemart 3.0.12 ...

The "search in the shop" module and the "filter by price" module run normally when i have clean the "com_virtuemart_cats" into the purge cache of joomla 3.4.8, but after i refresh the page the "com_virtuemart_cats" reappear each time and i lose the functionnality of the two module. They find nothing, simply seams very stuck due to cache.

I have check all modules cache and plugin page cache to NO.

My question is: How is it posssible to remove the cache system of the "com_virtuemart_cats" ?


Hi Mayapi,
Currently, it's not possible, only if you hack the core, you can disable it.

Here why in JOOMLAROOT\administrator\components\com_virtuemart\helpers\shopfunctions.php :

Code: [Select]
static public function categoryListTree ($selectedCategories = array(), $cid = 0, $level = 0, $disabledFields = array()) {

$hash = crc32(implode('.',$selectedCategories).':'.$cid.':'.$level.implode('.',$disabledFields));
if (empty(self::$categoryTree[$hash])) {

$cache = JFactory::getCache ('com_virtuemart_cats');
$cache->setCaching (1);
$app = JFactory::getApplication ();
$vendorId = vmAccess::isSuperVendor();
self::$categoryTree[$hash] = $cache->call (array('ShopFunctions', 'categoryListTreeLoop'), $selectedCategories, $cid, $level, $disabledFields,$app->isSite(),$vendorId,VmConfig::$vmlang);

}

return self::$categoryTree[$hash];
}

$cache->setCaching (1); force to use the cache.
If you comment it
// $cache->setCaching (1);
Then caching is active if Joomla cache is active.

I personally use a categories cache in controller on my sites and for module too when it's possible, so this VM cache do not speed up my site.
I think this cache should be optional, you have other way to speed up this eg. On implementing Cache in VM category controller i win more then 500ms for 24 products. And when page is in cache this function get not called anymore.
So you have double cache for nothing.

Perhaps someone from team want add this as a setting in Config ?

Mayapi

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: Category Cache Problem VM 3.0.8
« Reply #21 on: February 18, 2016, 16:06:52 pm »
@Studio 42

Virtuemart is an awesome e-commerce for Joomla, for sure if i was a beast coder in php ill do an extra function with enable/disable cache, but i think its not the priority of the devs today.

And not hopefully for me your comment dont work for me, i have try to comment like your script, and have try to turn the number to 0, have try all codes in first page of the topic but it do nothing more.

I think the cache is more complex than a simple function on this shopfunction.php

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10545
  • VM4.0.7 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Category Cache Problem VM 3.0.8
« Reply #22 on: February 18, 2016, 16:59:32 pm »
Hello friends from France,
Little hint, there is a virtuemart forum in france virtuemart.fr.

i have also a problem with the cache of Virtuemart 3.0.12 ...
You dont.

The "search in the shop" module and the "filter by price" module run normally when i have clean the "com_virtuemart_cats" into the purge cache of joomla 3.4.8, but after i refresh the page the "com_virtuemart_cats" reappear each time and i lose the functionnality of the two module. They find nothing, simply seams very stuck due to cache.
The cache com_virtuemart_cats has nothing todo with it. This cache stores an abstract category tree.
This looks like this
Code: [Select]
#x#a:2:{s:6:"output";s:0:"";s:6:"result";s:322:"<option   value="12">Product attributes</option><option   value="11">Product variants</option><option   value="2">Product pattern</option><option   value="3">Pagination</option><option   value="4">Headpiece</option><option   value="7">Wear</option><option   value="9"> - Lady</option><option   value="8"> - Mister</option>";}
It has nothing todo with the search or filter by price. This cache is valid as long you do not change the categories. So as long you do not change your cats, this cache can be valid for months. It is only used by building a category tree, for example when you use the vm category module. It is also not a problem, that the cache reappears.

I have check all modules cache and plugin page cache to NO.
Are you sure? There is an global option and an option per module.

My question is: How is it posssible to remove the cache system of the "com_virtuemart_cats" ?

Your question to disable the cache has nothing todo with your problem

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4680
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Category Cache Problem VM 3.0.8
« Reply #23 on: February 18, 2016, 21:06:49 pm »
Hum, milbo,
 i don't want to pollemic, but i have new problems in last VM release, because session value in Model to do lazy loading.
SO as this is really good to add some caching, you should provide a way to disable cache and store some Session values.
Eg When you return now from a product in category , you return to the Same page(pagination), but my customer will return to first page and not saved pagination. I think (but don't tested) that is the same case when you come back from cart or any view other then category, the pagination stay, if you go in same category again. This is good when you want it so. But for lazy loading the page is always first page ,so i have to overide all only because this session values.

So as new features is cool, and thank you for this, i think it where better if we can use old methods too so you don't have to overide or hack the code to remove new changes doing your shop working another way from one to other release.


Mayapi

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: Category Cache Problem VM 3.0.8
« Reply #24 on: February 19, 2016, 03:40:53 am »
@Milbo

after more intensive tests on all pages , i see you have right, the ajax problem of loading for the two modules seam working good, but not after my second menu.

Sorry about bad boggle !


AnthonyWang

  • Beginner
  • *
  • Posts: 47
  • VirtueMart Version: 3.2.1
Re: Category Cache Problem VM 3.0.8
« Reply #25 on: April 07, 2016, 20:07:40 pm »
i have same problem,i temporary use jquery to fixed it,as Studio 42 said you should provide a way to disable cache and store some Session values. it's a best way
Currently using :
Joomla 3.6.5 / Virtuemart 3.2.1 / PHP 5.5.9-1ubuntu4.17

AnthonyWang

  • Beginner
  • *
  • Posts: 47
  • VirtueMart Version: 3.2.1
Re: Category Cache Problem VM 3.0.8
« Reply #26 on: April 08, 2016, 20:34:01 pm »
Dear Studio42,today i tried your code on clean system and default templte,
but it's not works on joomla 3.5/VM 3.0.14
Currently using :
Joomla 3.6.5 / Virtuemart 3.2.1 / PHP 5.5.9-1ubuntu4.17

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4680
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Category Cache Problem VM 3.0.8
« Reply #27 on: April 08, 2016, 23:30:38 pm »
I think, it's a perhaps the router bug i found.
See http://forum.virtuemart.net/index.php?topic=133744.msg464009#msg464009
Sometime the category is not set(if you set category in the Joomla menu for eg.)

ivacademyru

  • Beginner
  • *
  • Posts: 37
  • ConsultingOnline Life & Business www.ivacademy.net
    • Love Academy ♥ Академия Любви - Life coach, Marriage counseling and Business consulting Live Chat Call Now www.ivacademy.net Проблемы в Отношениях, Жизни или Бизнеса? Звоните!
  • VirtueMart Version: vm3
Re: Category Cache Problem VM 3.0.8
« Reply #28 on: March 23, 2017, 16:25:15 pm »
I Have the same problems with Joomla! 2.5.28 and VirtueMart 3.0.4. Somebody could reply if this cache problem is solved by VM team because for shop to keep working its necesary to clean  cache 2 times /day manualy?
Web site design, eCommerce design, you own first Online Business Order Now and Get - 10% off  at IT IVAcademy lab just contact us, click www.ivacademy.net

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28529
  • Always on vacation
    • Jenkin Hill Internet
Re: Category Cache Problem VM 3.0.8
« Reply #29 on: March 23, 2017, 17:27:02 pm »
I see no cache problems using current VirtueMart 3.2 and Joomla 3.6.5  (I don't have J2.5.x any more to test with).    http://forum.virtuemart.net/index.php?topic=118683

Test any updates on a backup copy of the live site.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.14 10805  J 3.10.11 PHP 8.0.27