-
- 3,975 Posts
The "cacheable" box tells MODX that you want this resource cached, and it does exactly that. But in your case, I think the snippet calls are uncached, which could be by ignorance that the developer of the site did not turn on caching of the snippets upon making site live or by necessity where the snippet has to be uncached to function properly.
I would start looking at the template for that page and see how many snippet calls are there and if they are cached or not. For example:
Cached snippet call will look like this: [[snippetname? ¶meter1=`value`]]
Uncached snippet call will look like this: [[!snippetname? ¶meter1=`value`]]
Notice the exclamation sign, [[snippet... vs [[!snippet... ? The exclamation sign is telling MODX to run the code "uncached".
Ideally the snippets should be cached, but most of the pages on the website built by looking at various data points which change with user's interaction. So there are instances where it is necessary to run the code uncached because it needs to load the stuff dynamically in each request. A quick example would be paginated list of news items, you know the page1, page2, page3 etc.
This will go deep very quickly though, if you have developer at hand with you, you can call him/her and let them have a look or you can hire one of the MODX professionals.
I hope this helps.
-
- 24,544 Posts
There are so many things that can slow down a MODX site that it's difficult to list them all. Probably the most likely (besides uncached snippet calls -- BTW, any Wayfinder calls should be uncached [no exclamation point] unless the menus are customized for the individual user).
- lots of images, especially large ones
- getResources calls with TV filters or other complex conditions
- conditional output modifiers (tags that contain colons (:)
It might help if you post the Template and the Resource Content field for a particularly slow page.
-
- 89 Posts
Thanks for the explanation zi. That makes sense. There are not many snippets in the templates and the ones that are there are cached. So is way finder. There are a lot of getResources calls with TV filters like BobRay brought up.
-
- 24,544 Posts
+ on on Zi's suggestion of PdoTools.
If you really want speed, the best thing is to extend the modUser object. That allows you to put all the fields you now have in TVs into a custom database table.
Then, rather than getResources, you use a bit of custom code that pulls all the resources in a single query rather than the many queries getResources has to make for each collection. PdoTools is much faster, but it still needs to make multiple queries because of the way TVs are stored.
Here is one tool for doing that:
http://bobsguides.com/classextender-class.html
-
- 2,877 Posts