save views->execute result as a static variable Does it make sense (performancewise) to store view-&gt;execute() as a static variable in order to avoid running same view multiple times?
And then call view-&gt;render() wherewer I want to print the view? Does it make any sense? Or are there better options? Thank you
It heavily depends on what you're trying to achieve with caching.
If you're trying to avoid additional DB queries, you won't be adding much here. The view::execute() &amp; view::render() are already making use of its own caching system (if it's enabled on the view in question).
If you're trying to avoid all the theme/module hook execution overhead, yeah that will avoid it. Of course, the trade-off is modules/themes won't be able to modify a view (if that's needed) and you'll have to handle other cache invalidation scenarios as a result of your custom caching.
You'll have to make the call depending on how/what you're trying to optimize it that's worth the trade-off (generally, I would say no but that's opinion).