I have been having some horrible load speeds on a site I am working on, and I have been trying to narrow down what the problem is. Each section uses a different customization for the design, to do various things with nested content, menus ect. My loading time for pages was horrible, sometimes 20 seconds or more. This is not acceptable. So, I tired removing the customization, and just applying the main design. And, strangely, they are fast and snappy!
So, my question is, why do design customizations slow down my site so much? Is this normal? Customizations are very powerful, but if this is going to cause such huge speed issues, I am going to have to work around them.
Ideas?
I have figured out that it is nested content areas in my customizations that are causing the major slowdown. I am nesting two asset listings, which are used for menus.
It seems as though each time a page loads, those nested asset listings have to be loaded again, rather than being cached, which is a problem. They need to be cached, so that each page can load quickly…
Nic, I really enjoy watching you answer your own questions.
:)’ /> <img src=‘http://forums.matrix.squiz.net/public/style_emoticons/<#EMO_DIR#>/laugh.gif’ class=‘bbc_emoticon’ alt=':lol:
If you want them cached, set cache=1 on the design area tags (or enable it on the design area's details screen) and make sure system caching is on.
Yeah, I really should just not post a question, and wait for myself to answer the problem, which, is what happened here.
So, I figured it out. At least in my case, it was a very bad idea to nest two asset listings in my design, which would load up on every page. I tried everything with caching, but they were still very very slow. So, I went to a better solution, and that is loading up that content using ajax when the page loads. Now, my pages are AT LEAST 20 times faster, no lie, and I can finally focus on building the site again, and not wonder why my pages are so freaking slow!!
Thanks for the help.
I've seen a few sites that overuse customisations, and in some cases, that can be very detrimental to performance. As multiple parse files aren't that difficult to maintain, I'd lean towards reducing customisation where reasonable.
I only had 4 customizations. But in my case, it was the nested asset listings that were slowing it down, not the customizations themselves. Setting those nested content areas to print=no sped the right back up.
Greg, when I tested this, it did not seem to help at all with asset listings, they still loaded very slowly. Should every asset be cached in this situation?
Yes. But make sure you visit the customised design areas to ensure their cache flag is on as well, and that system caching is on, and that you are not looking as a user where the content is not cached (public user is best).
Nic, that's something I've been doing a bit of lately for nested asset listers too and was wondering if we should compare notes.
I've been injecting content into a specific ID. Like:
$(document).ready(function(){ $(".TheID").load("http://www.whatyouwantinthere.com").fadeIn("slow"); });
It works pretty well, especially if you overlay a loading gif to make users aware of the content loading. The only thing I've wondered about is that using Jquery to inject into the DOM is the poor search visibility of the injected content. The way I'm doing it somehow hides that content from spiders as it's not 'traditionally' in the source code of the page.
Is this similar to what you're doing?
[quote]Nic, that's something I've been doing a bit of lately for nested asset listers too and was wondering if we should compare notes.
I've been injecting content into a specific ID. Like:
$(document).ready(function(){ $(".TheID").load("http://www.whatyouwantinthere.com").fadeIn("slow"); });
It works pretty well, especially if you overlay a loading gif to make users aware of the content loading. The only thing I've wondered about is that using Jquery to inject into the DOM is the poor search visibility of the injected content. The way I'm doing it somehow hides that content from spiders as it's not 'traditionally' in the source code of the page.
Is this similar to what you're doing?[/quote]
Yeah, I am definetly not using the nested content area, it just won't work for me, speed wise.
I am using jQuery to load up my content, I am using the $.ajax function because of the added options, and, you can set it to cache, which is great. So far, this is working very well for me.
What would your .ajax function call look like?
$.ajax({ url: "http://www.whatyouwantinthere.com", cache: true, success: function(html){ $(".TheID").append(html); } });
That for some reason borks for me when loading an asset listing?
I wouldn't use append, as that will put the HTML after your selected element. I would use:
$.ajax({ url: "http://www.whatyouwantinthere.com", cache: true, success: function(html){ $(".TheID").html(html); } });
Is that working for you?
Slick. It works, thanks Nic.