Thread:Extension talk:Scribunto/Check whether title exists, otherwise load data/reply (6)

Yes, this is more or less the approach I'm using now. It's the best method for pages with some/many flags and the first expensive mw.loadData is totally worth. But for a single flag with an obvious name this is an overkill, and the current wikitext template deals with these frequent cases probably better (?).

A lot of pages have only one flag or two, and pretty obvious ones (e.g. sport infoboxes "Andorra 5 - Luxemburg 2", or Born / Died bio infoboxes). If "Flag_of_Andorra.svg and "Flag_of_Luxemburg.svg" exist (and they do) then we could just show them without needing to loadData. Of course a question is what is more expensive, checking 2-3 Media-namespace titles or loading a module. Anyway, maybe this discussion is just philosophical, as I haven't been able to measure and compare with the wikitext templates (is there a doc explaining how, or is it just about the time it takes to load a page?).