Tim implemented and enabled a trial of new '''limits for template inclusion''' for the English Wikipedia on 14_August, 2006. The most important part of these new limits is the ''pre-expand include size'', which is limited to 2MB (originally 1MB, see also the talk page).
==Metrics==
The HTML source of pages includes an HTML comment with the values of the inclusion size counters if the 'Pre-expand include size' is greater than one-thousand bytes. As an example, the page AIDS (as of writing this) contains the following in its generated HTML source:
<!-- Pre-expand include size: 369755 bytes Post-expand include size: 140755 bytes Template argument size: 117643 bytes Maximum: 2048000 bytes -->Note that sub-templates are cumulative in the calculation of the pre-expand include size. If template A contains
{{b}}{{b}}{{b}}{{b}}{{b}}
and template B is 100 bytes long, then the total pre-expand include size of {{a}} is the size of template A (25 bytes) plus five times the size of template B - 525 bytes total. However, if template A instead contained {{b}}{{b}}{{b}}{{b}}{{b}}
its pre-expand include size would be just 48 bytes, because sub-templates within unincluded sections are not evaluated.
==Inclusion==
Text inside <noinclude> sections or outside <includeonly> sections of templates do add to the pre-expand size. However, calls to other templates in such sections are evaluated based on their 'unexpanded' size. Tim proposes to transclude template documentation from a subpage http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_%28technical%29&diff;=prev&oldid;=69888944.
See Wikipedia:Template_doc_page_pattern.
==Special:ExpandTemplates==
Tim also created a related new special page at Special:ExpandTemplates. It is used to manually expand wikitext containing template calls. The calls are recursively expanded to their plain wiki-text. Special:ExpandTemplates also recursively expands all ParserFunction calls — something that cannot be achieved with substitution (see also bug 2227).
==References==
* Villiage pump technical (discussion now moved to Wikipedia_talk:Template_limits)
* Tim's posting on wikipedia-l
==See also==
*Category:Pages_exceeding_template_inclusion_limits
{{PAGENAME}}