Page 1 of 1

Help: Smarty Caching

Posted: Mon Jun 10, 2013 11:59 pm
by bbonora
I'm interested in creating a module that allows users to create JavaScript to use within themes. I was thinking it would work similar to the Layout -> StyleSheet functionality. I understand how to store the data within the database but what I'm struggling with is how to utilize smarty and it's caching capabilities. Ideally I would like it to function like the combined StyleSheets does.

I've noticed that when a page is accessed a temporary file is written for the stylesheet in the /tmp/cache/ directory, it usually looks something like this: "stylesheet_combined_####.css". In addition a file called *.dat is written and then deleted. I want to know more about what is going on when this occurs.

I was hoping somebody could show me a simple example of what smarty functions are being called when the caching occurs. I realize this is a complex topic but if somebody could explain the theory as well as a simple code example I would greatly appreciate it.

Thanks,
Ben

Re: Help: Smarty Caching

Posted: Tue Jun 11, 2013 12:24 am
by calguy1000
{cms_stylesheet} doesn't use Smarty Caching.

It simply gathers all the appropriate stylesheets (according to criteria)... passes them through smarty, and outputs the file to a generated name in tmp/cache.

Re: Help: Smarty Caching

Posted: Tue Jun 11, 2013 12:44 am
by bbonora
Where is the file located that's actually writing to the tmp directory? Would you recommend using smarty for the application I've described?