Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Themes /

Discuss SilverStripe Themes.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Repeating same control loop & performance

Go to End



Community Member, 66 Posts

26 September 2011 at 4:07am

Edited: 26/09/2011 4:08am

Hi there, a client of mine wants a jQuery based preview of articles with one large image and two smaller ones, circulating. They all include elements from the same <% control %> block. I am wondering how the SS works - does it recognize the same method is being run multiple times and caches it. Or would repeating the control block three times run the method and the DataObject::get in it three times, thereby increasing the page rendering time?

What's a good solution in this case. I'm thinking - a class private array to save the DataObjectSet if it hasn't been run yet?

Appreciate any input on this! :)