Wikipedia:Post-expand include size
Essay on editing Wikipedia
From Wikipedia, the free encyclopedia
This essay describes the MediaWiki parser handling of the resource known as the "post-expand include size" of the text passed from templates and other transcluded content.
This is an essay. It contains the advice or opinions of one or more Wikipedia contributors. This page is not an encyclopedia article or a Wikipedia policy, as it has not been reviewed by the community. |
The post-expand include size is the sum of the lengths of the expanded wikitexts generated by transcluded pages (e.g., templates and modules), parser functions, and variables. For years, the limit of the post-expand size has been 2,097,152 bytes (221 bytes), or 2,048 KiB as determined by $wgMaxArticleSize. Pages which exceed this limit are automatically categorized into Category:Pages where post-expand include size is exceeded.
How to see the current post-expand size
Edit the page, then find "Parser profiling data: (help)" almost at the bottom of the page in Show preview mode. The parser profiling data is just above the category links and the fine-print privacy policy and disclaimers, etc. links. You may need to click on the drop-down arrow to show the table. Post-expand include size is one of the items listed in the parser profiling data.
Calculating post-expand size
When a template returns some generated or displayed text, every character counts in the post-expand include size. Also, text returned by a #if or #switch parser function counts double; for example, the 4-letter string "ABCD" returned from a #ifeq function would count as 8 letters (8 bytes). When displayed by a #if also around a nested #switch, each character counts triple, and so "ABCD" would count as 12 letters.
Each internal space counts as 1 byte per level
Each internal space adds one more at each level, where double-nested "AB CD" as 5 bytes would use 15 bytes in post-expand size, but triple-spaced "AB CD" (as 7 bytes) would use 21 bytes of post-expand size, when double-nested as the result of a #switch inside an #if function.