Prefer Title::getLocalUrl() or Title::getFullUrl() on extensions?

extensions

#1

In extensions that need to build links to special pages, page actions, etc with the Title class, is it recommended to use getLocalUrl() or getFullUrl()?

Looking at the code, getFullUrl() calls getLocalUrl(), and the only difference seems to be the absence of the server part in the generated URL for getLocalUrl(), so for me it makes sense to use getLocalUrl() whenever possible, as it will be a small performance improvement.

Are my thoughts correct?


#2

I too would always use getLocalUrl unless you have some special case and you need to use the other one. Especially the links get cached, wikis accessible over both http and https would inconsistent behavior if full urls are used.