Forums: Index > Watercooler > How we fix slow articles

I have come up with a technique that will allow contributors to create arbitrarily complex templates without making page loads slower for other folks that may not be interested in the features provided by those templates. This "cache property" technique performs all the complex work on a subpage, then stores the results of the processing in a property or properties with the type "code". The main page simply loads the result property and is freed of the labor of recalculating it. A short technical description may be found below. Anyone interested in details please contact me.

One idea floated earlier was to validate values for consistency. Such a quality control page could be done this way. EG: does the page name or any of the values have all cap names, are the locations valid place names, do the dates make sense (eg child born to a woman that would have been 9 years old).

  • If any of these conditions are true, then the article is placed in hidden maintenance categories EG: articles with all cap names, articles with inconsistent dates, and so on.

If this "cache property" method is fruitful, it will mean that we don't have to choose between speed and features. We can have both. The cost is only that the data from time consuming templates will be out of date until the page is updated (either manually with a refresh, or via someone using Help:AutoWikiaBrowser to periodically refresh them.

In a nutshell...

  • Say page foo calls Template:LetsWatchPaintDry
  • Create page foo/someSubPage
  • Move your slow templates to that page and store the results in a property or properties of type code For instance:
    {{#set:DriedPaint={{LetsWatchPaintDry}} }}
  • Display the results on the main foo page with a normal show call, EG:

~ Phlox 17:53, October 10, 2009 (UTC)