Quick question for any modx expert out there, are there any performance advantages to using static resources like chunks and templates?
As these are static files does this mean that in theory the database will have a smaller footprint and not come under such heavy load or does the fact that there is a link to the static resource in the DB negate any speed advantages?
-
☆ A M B ☆
- 24,524 Posts
It would all depend on the server in question - how it's configured and what kind of load it's under. The biggest advantage is in minimizing the cache files. Instead of the whole element in the cache, all you have is the link to the static element file.
Another advantage is the ability to edit them in your favorite editor and put them under version control.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
Thanks for the feedback guys, it's a fairly complicated design with a moderate amount of traffic on a VPS running Centos 6.2.
I was thinking from the db access times, if it's only dragging a link out the db rather than code this load would be less?
-
☆ A M B ☆
- 24,524 Posts
Not really, the bottleneck is the search for the requested data, not how much it's returning. Keep in mind that a database is basically just a set of compressed data files, and a database engine just parses the file (table) specified in the SQL query. A good way to get a feel for what's going on is to examine an organized text based storage system, such as XML or JSON, where you can read the storage files themselves (more or less). JSON is a bit closer to the concept of an SQL engine, as it also stores metadata for the data in question.
Thanks Sottwell, I figured as much. I guess as long as it doesn't slow down the site its a nice idea to have these type of resources static. It all adds to the rich experience that is Modx!
Thanks again for the input, it is much appreciated. Are there any real dis-advantages to using static resources?
-
☆ A M B ☆
- 1,780 Posts
I think one disadvantage is not being able to use a rich text editor in TV's once you switch from document to static. Oh, and the size of the entry field for the TV's reduces to postage stamp size as well.
As such, for sites I would ideally like to store html in a static resource for, if there's any user modifiable rich text TV's it can't be static.
Thanks for the feedback everyone, it's also great if you want to store the files outside of the standard file structure too, sharing the static resources with another site without having to share the actual db is a great feature.
-
☆ A M B ☆
- 1,780 Posts
I feel sorry for the old includeFile snippet. It did such good work for so long and now no one loves it anymore. Being able to edit outside of the manager without setting up includeFile is a most wonderful thing though.
RIP Sweet includeFile snippet... oops I mean, Live Long and Prosper in Evo...
:~}