News:

Looking for documentation? Take a look on our wiki

Main Menu

Category Cache Problem VM 3.0.8

Started by micpic, April 21, 2015, 09:48:58 AM

Previous topic - Next topic

Studio 42

Hi,
I see all day this cache problem, Why the team does not try to add my solution or another one?

jjk

Quote from: Studio 42 on June 30, 2015, 17:12:28 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

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

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

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

Quote from: Mayapi 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" ?


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 :

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

#21
@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

Quote from: Mayapi on February 18, 2016, 00:00:08 AM
Hello friends from France,
Little hint, there is a virtuemart forum in france virtuemart.fr.

Quote from: Mayapi on February 18, 2016, 00:00:08 AM
i have also a problem with the cache of Virtuemart 3.0.12 ...
You dont.

Quote from: Mayapi on February 18, 2016, 00:00:08 AM
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

#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.

Quote from: Mayapi on February 18, 2016, 00:00:08 AM
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.

Quote from: Mayapi on February 18, 2016, 00:00:08 AM
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

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

#24
@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

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

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

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

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

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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