Jon,
I've looked at your mod and installed it. One thing that troubled me was the fact that it does a query for every single URL rewrite. Usually the same query over and over again. For example: Select category from xcart_categories WHERE categoryid='505';
To fix this, I simply added a &title= . urlencode(seo_title_of_product_or_category_name) to all of my urls (in appropriate products.tpl (or in my case, products_t.tpl) file, subcategories.tpl, categories.tpl, and a few misc others).
Then, in your code I before the query I added:
Code:
if (!empty($options['title'])){
$options['result_title'] = $options['title'];
unset($options['title']);
}
I also had to unset title from the _category_callback and _product_callback functions to remove ?title= from the URL:
Code:
function _category_callback($found, $uri_only = false, $title = false) {
$options = $this->_check_uri($found[3]);
$options['result_title'] = $title;
if($options['cat']){
$filename = $this->_category_filename($options);
unset($options['title']);
$filename .= $this->_query_string_append($options);
if($uri_only)
return $filename;
else
return $found[1] . $found[2] . $this->_base_uri . $filename . $f
}else{
return $found[0];
}
}
This saved about 30 - 50+ queries per page. I am using memcache and it still sped things up significantly.