raintpl3
raintpl3 copied to clipboard
Possibly optimize checkTemplate function
I feel like this function could be optimized quite a bit by caching some variables, and not re-calculating them every time the function is called. checkTemplate is always called regardless of cache, and if you have a lot of {include}'s in your code, it's called multiple times.
What do you think?
complex to solve: memcached and APC are server specific session are slow and each user has its own
A fast solution it could be with a watch script (crontab or screen) that compile the template when they change, and on the Tpl class a configuration that tell RainTpl to just load the template, something like $conf["compile_template"] = false;
.
With APC enabled this will go even faster.
I think memcached/apc support would be great, perhaps just have user define their own get/set functions for cache, so they can use their existing memcached connections. And if these are not defined, fall back to how it is right now.
that could be nice, I think the best way is to have a cache plugin where to implement all these features
A super simple solution along the lines of what @rainphp mentioned would be a config option to skip_compile
and add a script that compiles all the templates in the defined template folders, and moves these to the cache/compiled folder. If skip_compile === true
then just load the template directly from the cache dir. :)