Rotem Liss | 1 Dec 12:01 2007

Re: Announcement: #ifexist limit

Tim Starling wrote:
> Please copy this to your local village pump or other relevant on-wiki forum.
> 
> Werdna's #ifexist limit feature is now live. In response to complaints of 
> template breakage, I have increased the limit on Wikimedia wikis 
> temporarily, from 100 to 2000. Barring a coup, it will stay at 2000 for 
> about a week, and then we'll lower it to 100.
> 
> Please use this one-week period to check pages and templates that use 
> #ifexist heavily. Look in the HTML source of the preview or page view. 
> There will be a "limit report" that looks like this:
> 
> <!--
> Pre-expand include size: 617515/2048000 bytes
> Post-expand include size: 360530/2048000 bytes
> Template argument size: 51168/2048000 bytes
> #ifexist count: 1887/2000
> -->
> 
> This is the limit report from
> http://commons.wikimedia.org/wiki/Template:Potd/2007-12 ,
> one of the pages that will break.
> 
> At the end of the week, any pages which have a #ifexist count of over 100 
> will cease to be rendered correctly (after the next edit or cache clear). 
> All #ifexist calls after the hundredth will be treated as if the target 
> does not exist.
> 
> In some cases it may be possible to rewrite your templates so that they 
> still do the same thing, but with less #ifexist calls. In other cases, you 
(Continue reading)

Platonides | 2 Dec 18:57 2007
Picon

Re: Announcement: #ifexist limit

Rotem Liss wrote:
> I suggest to cache these calls results (as done with "#time"), and to count
> multiple calls to the same page as one call, in case someone wants to check the
> same page multiple times. (Title objects are cached anyway, and so are the
> article IDs, so they don't have to cause multiple queries anyway; they are
> harder to check, though.) "Then" and "else" should not be cached, just the title
> and its result.
+1
In my little journey in the #ifexist abuse i have found that people use 
this kind of constructs quite frequently:

Lorem ipsum (A ? <strong>: <small>) dolor (A ? </strong>:</small>) sic 
amet consectetuer adipiscing elit. (A ? "Proin quam. Praesent vulputate 
libero eu arcu." : "")  Cum sociis natoque penatibus et magnis dis 
parturient montes, nascetur ridiculus mus. (A ? "Pellentesque vitae 
diam." : ) Proin elementum, purus eu rhoncus rhoncus, lacus nisi 
hendrerit metus, et congue nunc ante vel odio.

So it's fixed doing:
if (A) {

Lorem ipsum <strong>dolor</strong> sic amet consectetuer adipiscing 
elit. Proin quam. Praesent vulputate libero eu arcu. Cum sociis natoque 
penatibus et magnis dis parturient montes, nascetur ridiculus mus. 
Pellentesque vitae diam. Proin elementum, purus eu rhoncus rhoncus, 
lacus nisi hendrerit metus, et congue nunc ante vel odio.

} else {

Lorem ipsum <small>dolor</small> sic amet consectetuer adipiscing elit. 
(Continue reading)


Gmane