Well, after looking into the OC v.3.0.2.x Code, I found very similar Lines in my OC v.1.5.6.5,
when it comes to the Routine, as shown below, used to speed up this Task and so OC !
So, one could try, if this Budgetneon.com designed Category CACHE System still works,
by adapting this OC v.1.5.6.x Line:
$cacheid='product.gettotalproducts.'.md5($sql).(int)$customer_group_id;
to make the DB Access work with OC v.3.x, then, the Categories Numbers would
be called from the Cache Section, and no longer counted from/in the DB, and this usually
improves Category Counting Performance very very mucho.
---
It's the
catalog/model/category/product.php File, wich has to be modified:
DEFAULT OC Code OC v.1.5.x - 3.x:
Code: Select all
if (!empty($data['filter_manufacturer_id'])) {
$sql .= " AND p.manufacturer_id = '" . (int)$data['filter_manufacturer_id'] . "'";
}
$query = $this->db->query($sql);
return $query->row['total'];
}
to be replaced with THIS:
Code: Select all
if (!empty($data['filter_manufacturer_id'])) {
$sql .= " AND p.manufacturer_id = '" . (int)$data['filter_manufacturer_id'] . "'";
}
//JTI MOD v.1.5.6.x, WILL NOT work in OC v.2.1.+ this way !!
// $query = $this->db->query($sql); // default OC Line
// return $query->row['total']; // default OC Line
$cacheid='product.gettotalproducts.'.md5($sql).(int)$customer_group_id;
$total=$this->cache->get($cacheid);
if ($total === null ) {
$query = $this->db->query($sql);
$total = $query->row['total'];
$this->cache->set($cacheid,$total);
}
return $total;
// END JTI MOD
}
Hopefully, someone of the v.3 Insiders will be willing to change and test it.
Good Luck!
Ernie
---
PS: A different nice Version, by WeismannWeb.com, adding all those Numbers into one single file,
separated into Header- and Category Files, containing other cached Data too, can be found here,
it's much more compehensivly coded, and would require a total rewrite, to make it work
in V.2 + Versions, just to mention this. I use 'em both, in my 1.5.6.5 Version Sites, depending on Mood
http://www.codegist.net/snippet/xml/cac ... annweb_xml
and it's cache files look like this. Performance-wise, it's about the same, by use of a few Cat's only...
---
Budgetneon.com Category Cache Solution: