Translations:Manual:LinkBatch.php/2/en

When MediaWiki renders a page, it must go through all of the links in the page to see whether or not they actually exist. If they don't exist, a "new" class is added to the anchor tag so that it will be shown as a redlink. If the page has a lot of links, this can become an expensive process that slows down rendering the page. To eliminate this problem, the LinkCache class was created. A LinkCache object stores cached information about all the pages linked from one source (typically a page). Generating the LinkCache itself is still expensive, however, if each linked page is queried separately. To get around this problem, the LinkBatch class can be used. The LinkBatch class allows all the pages to be added to a batch query so that only one call to the database is necessary.