Content deleted Content added
Dinoguy1000 (talk | contribs) document the unstrip post-expand size count, courtesy User:Izno |
|||
(12 intermediate revisions by 8 users not shown) | |||
Line 1:
{{pp-vandalism|small=yes}}{{pp-move-indef}}
{{infopage|WP:TLIMIT|H:TLIMIT}}
The [[MediaWiki]] software that powers Wikipedia has several parameters that limit the complexity of a page, and the amount of data that can be included. These limits mainly concern data that is [[Wikipedia:Transclusion|transcluded]] or [[Wikipedia:Substitution|substituted]] during expansion of a page, as opposed to data directly in the source of the page itself. This page explains how and why these limits are applied, and how users can work within the limits.
Line 77:
== Post-expand include size ==
{{shortcut|WP:PEIS}}{{Tracked|T275319|open}}{{Tracked|T189108|open}}
The '''post-expand include size''' is the sum of the lengths of the expanded wikitexts generated by templates, parser functions and variables. Whenever the parser is instructed by the source code of a page to expand a template etc. (that is, to replace it by transclusion or substitution), the parser adds together the length of the expanded wikitext generated by the template etc. and the current counter value of the page. If this sum is more than the '''post-expand limit''' (same as the [[WP:CHOKING|max article size limit]]), the initial template etc. is not replaced and an error message is added as a comment in the output HTML. Otherwise the post-expand counter is increased to the new value, and parsing continues. A template that is expanded more than once in the page contributes more than once to its post-expand include size.▼
▲The '''post-expand include size''' is the sum of the lengths of the expanded wikitexts generated by templates, parser functions and variables. Whenever the parser is instructed by the source code of a page to expand a template etc. (that is, to replace it by transclusion or substitution), the parser adds together the length of the expanded wikitext generated by the template etc. and the current counter value of the page. If this sum is more than the '''post-expand limit''' (same as the [[WP:CHOKING|max article size limit]]; see <code>[[mw:Manual:$wgMaxArticleSize|$wgMaxArticleSize]]</code>), the initial template etc. is not replaced and an error message is added as a comment in the output HTML. Otherwise the post-expand counter is increased to the new value, and parsing continues. A template that is expanded more than once in the page contributes more than once to its post-expand include size.
Template invocations with no arguments have an expanded text cache. So if <code><nowiki>{{foo}}</nowiki></code> includes the second-level meta-template <code><nowiki>{{bar}}</nowiki></code>, then multiple invocations of <code><nowiki>{{foo}}</nowiki></code> will only increment the post-expand include size for the fully-expanded <code><nowiki>{{foo}}</nowiki></code>; the secondary include <code><nowiki>{{bar}}</nowiki></code> is only counted once. But if you included the same template multiple times with <code><nowiki>{{foo|arg}}</nowiki></code>, then the secondary templates are counted each time, even if the argument is the same.▼
▲Template invocations with no arguments have an expanded text cache. So if <code><nowiki>{{foo}}</nowiki></code> includes the second-level meta-template <code><nowiki>{{bar}}</nowiki></code>, then multiple invocations of <code><nowiki>{{foo}}</nowiki></code> will only increment the post-expand include size for the fully-expanded <code><nowiki>{{foo}}</nowiki></code>; the secondary
Pages exceeding the post-expand include size limit are automatically added to [[:Category:{{MediaWiki:post-expand-template-inclusion-category}}]] ([https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle={{urlencode:Category:{{MediaWiki:post-expand-template-inclusion-category}}}}&cmprop=title%7Ctimestamp&cmlimit=500&cmsort=timestamp&cmdir=desc&format=xml recent additions]).▼
▲Pages exceeding the post-expand include size limit are automatically added to [[:Category:{{MediaWiki:post-expand-template-inclusion-category}}]] ([https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle={{urlencode:Category:{{MediaWiki:post-expand-template-inclusion-category}}}}&cmprop=title%7Ctimestamp&cmlimit=500&cmsort=timestamp&cmdir=desc&format=xml recent additions]). [[Template:Citations broken from PEIS limit]] may be manually added to the page when citations or templates are broken as a result of the issue.
=== Using comments, noinclude and onlyinclude ===
Only data that survives the preprocessor expansion stage is counted towards the post-expand counter. The length of HTML comments in the wikitext (which are not reproduced in the HTML source produced) is not included in the post-expand counter. Code which is either inside a
===Nested transclusions===
Note that the sizes of the wikitexts of all expanded templates and parser functions are added, even in the case of nesting (see [[phab:T15260]]), so extra levels increase the count. If page A transcludes B and B does nothing but transclude C, then the size of C will be counted ''twice'' towards the post-expand include size on page A, and similarly if a template consists of a parser function call, or a parser function has a template call as parameter, etc. Possible substitutions to reduce nesting include:
*<
*{{tl|navboxes}} replaced with {{tl|navboxes top}} and {{tl|navboxes bottom}}
*{{tl|trim|...}} replaced with {{pf|if|1|...}}
*
=== Non-rendered transclusions ===
Non-rendered tranclusions still count towards limit. For example, a page which contains only <
The same applies to [[Wikipedia:Lua|Scribunto modules]]. For example, <
return { main = function() end } -- p.main() has no return value</syntaxhighlight>
Line 108:
* {{ml|infobox|infoboxTemplate}}, {{ml|infobox3cols|infoboxTemplate}} inside infobox templates.
* {{ml|flag|}}, {{ml|flagg|}} for articles with large numbers of flags.
* {{ml|cite
* {{ml|episode table|main}}, {{ml|episode list|}} for episode lists.
Line 122:
Example:
Arguments in the template call which do not match any parameter tag in the template do not count.
Line 136:
== Expensive parser function calls ==
{{Redirect|WP:EXPENSIVE|the essay "Redirects are costly"|WP:COSTLY}}{{Further|mw:Manual:$wgExpensiveParserFunctionLimit|Template:Expensive}}{{shortcut|WP:EXPENSIVE}}
There is a limit of 500 to the '''expensive parser function count''', i.e., the number of calls of expensive [[:mw:Help:Magic words#Parser functions|parser functions]], which are:
* <code>[[Help:Magic words#Conditional|#ifexist]]<
*
* [[mw:Help:Magic words#Technical metadata|PAGESIZE]]
* CASCADINGSOURCES
Line 158 ⟶ 157:
==Unstrip post-expand size==
The '''unstrip post-expand size''' counter tracks the total bytes added via [[
==#time==
Line 174 ⟶ 173:
==References==
* [[:Special:PermanentLink/70023682#New template limits.2C Special:ExpandTemplates|Village pump technical]] (discussion now moved to [[Wikipedia talk:Template limits]])
* [http://lists.wikimedia.org/pipermail/wikipedia-l/2006-August/027271.html Tim's posting on wikipedia-l]
* [[mw:NewPP parser report]]
|