Jump to content

Edit History

hugolin69

hugolin69

Hi,

I spent many hours in that problem. I am trying to cache some files.

In one function, I setup my file for cache

$id_cache = 'nameofmymodule|'.(int)Tools::getValue('id_product');
$tpl_file = "fileinviewfrontmodulefolder.tpl";     
		
$output .= $this->display(__FILE__, $tpl_file, $this->getCacheId($id_cache));	

On the other hand, in an other function in the same module, I check if I find the cache

$id_cache = 'nameofmymodule|'.(int)Tools::getValue('id_product');
$tpl_file = "fileinviewfrontmodulefolder.tpl";   


if (!$this->isCached($tpl_file, $this->getCacheId($id_cache)))
	echo "no cache found";
else
	echo "cache found";

I got my cache file in the right folder.

 /var/prod/smarty/cache/nameofmymodule/22/1/1/3/3/1/8/72/83/69/7283698c25e3d6ce82a73a43c4d533123765835e.fileinviewfrontmodulefolder.tpl

 

But the isCached function keeps returning "no cache found", even the file is here.

In others modules, I use the same structure, except if is with fetch(). I am under 1.7.6.9.

Any help would be appreciate.

 

Same resultat if I replace the var $tpl_file with, which is in a current and accepted folder in the code of Module Class.

module:nameofmymodule/views/templates/front/fileinviewfrontmodulefolder.tpl

 

hugolin69

hugolin69

Hi,

I spent many hours in that problem. I am trying to cache some files.

In one function, I setup my file for cache

$id_cache = 'nameofmymodule|'.(int)Tools::getValue('id_product');
$tpl_file = "fileinviewfrontmodulefolder.tpl";     
		
$output .= $this->display(__FILE__, $tpl_file, $this->getCacheId($id_cache));	

On the other hand, in an other function in the same module, I check if I find the cache

$id_cache = 'nameofmymodule|'.(int)Tools::getValue('id_product');
$tpl_file = "fileinviewfrontmodulefolder.tpl";   


if (!$this->isCached($tpl_file, $this->getCacheId($id_cache)))
	echo "no cache found";
else
	echo "cache found";

I got my cache file in the right folder.

 /var/prod/smarty/cache/nameofmymodule/22/1/1/3/3/1/8/72/83/69/7283698c25e3d6ce82a73a43c4d533123765835e.fileinviewfrontmodulefolder.tpl

 

But the isCached function keeps returning "no cache found", even the file is here.

In others modules, I use the same structure, except if is with fetch(). I am under 1.7.6.9.

Any help would be appreciate.

×
×
  • Create New...