discuss.answer
By template, do you mean a Tpl chunk? That's technically not a template in MODX (though it's very template-like).
If you are getting a Tpl chunk with $modx->getChunk(), it is fairly fast, and if the page and the snippet are cached, you shouldn't see any speed difference.
---------------------------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
MODx info for everyone:
http://bobsguides.com/MODx.html
-
☆ A M B ☆
- 24,524 Posts
I think he's referring to the actual template, BobRay. And I don't expect that there would be a measurable difference in performance in loading the template via an include snippet.
I thought so at first, but then he mentioned "tpl file", so I'm not sure.
No im talking about the template.
Just wondering if the approach of loading up a template file: mynewtemplate.blah
QWill this approach have any performance issues, as the parser is essentially dealing with just one snippet containing everything?
-
☆ A M B ☆
- 24,524 Posts
The way that works is that the resource requested is fetched from the database (if it's not cached, that is). Then its template as specified in the "template" field is fetched and processing begins. With Evo, the snippet would be run through the PHP eval() function, but I believe Revo handles snippet (and plugin) code differently. Anyway, the template's snippet will be processed, returning the full template. Then that is processed as usual. So all it does is add one brief step to the parsing process. I seriously doubt it would add a significant load to the server, nor would it take more than a fraction of a millisecond.
-
☆ A M B ☆
- 24,524 Posts
It skips the step of loading then writing the snippet's code to file and including it. What static resources do is to simply store the path to the file and use that instead of a field from the database. So except for snippets, it really doesn't make a great deal if difference as far as the parsing process goes.