Author Topic: Cache bug  (Read 19087 times)

doorknob

  • Jr. Member
  • **
  • Posts: 151
Cache bug
« on: July 03, 2008, 20:34:06 pm »
Running with Joomla caching switched on causes a number of problems. The most prominent is the duplication of products in the browse list. This affects all browse list styles except 'Flat Product List'. The cause of this problem is the use of the template class function fetch_cache(). This function caches the template file and when the same file is called many times on the same page, as is the case on browse pages, the cached value is recalled and every entry appears the same.

The cause of this is that the function vmTemplate->getCacheId() expects that the variables $modulename, $pagename, $product_id, $category_id, $manufacturer_id, $auth, $limitstart, $limit have been set up prior to the function being called but they have not. That means that every product get the same cache ID and so the cached version is reused for a different product.

A short-term workaround can be implemented in browse_layouttable.tpl.php and browse_notables.tpl.php by changing the call to fetch_cache() to fetch().

Note: 'Flat Product List' is not affected by this problem because it does not use a template file and therefore cannot be cached.

Tested on J1.5.3 with VM nightly update 2008/7/2.

Regards
Phil

aravot

  • Peter
  • Moderator
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
Re: Cache bug
« Reply #1 on: July 23, 2008, 21:44:37 pm »
This has been fixed in latest nightly build 1481

guimplenchik

  • Beginner
  • *
  • Posts: 26
Re: Cache bug
« Reply #2 on: October 16, 2008, 01:01:15 am »
Strange thing..I thought this bug is fixed (#2227 https://dev.virtuemart.net/cb/issue/2227) , but I use J!1.0.15 + VM 1.1.2 with core cache enabled and this problem still exists..

Any suggestions?

Thanks

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27572
  • Always on vacation
    • Jenkin Hill Internet
Re: Cache bug
« Reply #3 on: October 16, 2008, 11:26:47 am »
Maybe fixed for J!1.5.x but not for J!1.0.x - I no longer have old versions of Joomla around to check this.
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 VM 3.6.8 10204 on Joomla 3.9.13 PHP 7.0.33

jordank87

  • Beginner
  • *
  • Posts: 24
Re: Cache bug
« Reply #4 on: November 13, 2008, 16:45:07 pm »
I tried this on joomla 1.5.7 and vm 1.1.2 and still have the "bug" meaning products are duplicated in the categories???


Yereverluvinunclebert

  • Jr. Member
  • **
  • Posts: 88
Cache bug VM theme displays duplicate products
« Reply #5 on: December 02, 2008, 14:10:24 pm »
I am using 1.1.2 on my site with a theme and I am experiencing the same issue. Do you know when is this going to be fixed?

I have implemented the workaround so my site is OK for the moment but unfortunately I have a client who is not impressed by the speed of Joomla 1.5 and so I have to do a load of tuning to get the site working as quickly as it can.

Cacheing working as it should, on the products as displayed by a VM theme, is a necessity for me.

Yereverluvinunclebert
Yereverluvinunclebert - Maker of some steampunk widgets of distinction

archerwebsolutions

  • Beginner
  • *
  • Posts: 9
Re: Cache bug
« Reply #6 on: March 26, 2009, 00:53:29 am »
Running with Joomla caching switched on causes a number of problems. The most prominent is the duplication of products in the browse list. This affects all browse list styles except 'Flat Product List'. The cause of this problem is the use of the template class function fetch_cache(). This function caches the template file and when the same file is called many times on the same page, as is the case on browse pages, the cached value is recalled and every entry appears the same.

The cause of this is that the function vmTemplate->getCacheId() expects that the variables $modulename, $pagename, $product_id, $category_id, $manufacturer_id, $auth, $limitstart, $limit have been set up prior to the function being called but they have not. That means that every product get the same cache ID and so the cached version is reused for a different product.

A short-term workaround can be implemented in browse_layouttable.tpl.php and browse_notables.tpl.php by changing the call to fetch_cache() to fetch().

Note: 'Flat Product List' is not affected by this problem because it does not use a template file and therefore cannot be cached.

Tested on J1.5.3 with VM nightly update 2008/7/2.

Regards
Phil

These changes appear to be in my code, and yet when the cache is on, we still have a problem with the first items in the product list being duplicated. Any ideas?

aravot

  • Peter
  • Moderator
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
Re: Cache bug
« Reply #7 on: March 27, 2009, 00:31:08 am »
I can not duplicate this on my test site, do you have a URL and your Joomla+VirtueMart settings.

dchaplinsky

  • Beginner
  • *
  • Posts: 2
Re: Cache bug
« Reply #8 on: July 04, 2009, 13:29:37 pm »
Hi.

I've got the same issue with Joomla 1.5.11 & Virtuemart 1.1.3 stable on my website http://ink.su (now caching disabled, of course).

The reason was the third-party template for virtue, which I'm using. After switching to default template issue gone. I will make additional investigations and come with solution for ppl who using custom templates.

dchaplinsky

  • Beginner
  • *
  • Posts: 2
Re: Cache bug
« Reply #9 on: July 04, 2009, 13:34:10 pm »
Ah, you've just disabled caching for subitems in default template :)
grrr

Yereverluvinunclebert

  • Jr. Member
  • **
  • Posts: 88
Re: Cache bug
« Reply #10 on: July 09, 2009, 18:41:40 pm »
VM shows multiple versions of the same product
==============================================

The cause of this is that the function vmTemplate->getCacheId() expects that
the variables $modulename, $pagename, $product_id, $category_id,
$manufacturer_id, $auth, $limitstart, $limit have been set up prior to the
function being called but they have not. That means that every product get
the same cache ID and so the cached version is reused for a different product.

A short-term workaround can be implemented in browse_layouttable.tpl.php
and browse_notables.tpl.php by changing the call to fetch_cache() to fetch().
Yereverluvinunclebert - Maker of some steampunk widgets of distinction

Luciffere

  • Jr. Member
  • **
  • Posts: 66
  • Web Design de Calitate
    • Web Design de Calitate
Re: Cache bug
« Reply #11 on: July 14, 2009, 13:40:48 pm »
This happened to me... See my post http://forum.virtuemart.net/index.php?topic=57971.0
Gift based on total order
Web design, logo, branding, joomla, virtuemart, flash. Portofoliu web design: http://www.luciffere.ro/portofoliu.html