I’m fairly new to EE development, but I’ve noticed that the convention seems to be to use the {site_url} value on all links. This results in those links being rendered out as absolute urls, which over the last decade and a half I’ve been doing this sort of thing has always been a no-no for a variety of reasons (mostly performance-related since it requires an extra round-trip from the DNS server). Pretty much no major CMS that I’ve worked with over the years (Drupal, Wordpress, Joomla, TeamSite, Vignette, DotNetNuke…) used absolute links as convention, but yet EE does—why?
The reason I personally don’t like it is that it makes local development really hard when, for example, I’m offline. If all my links, all my assets, all my images, all my CSS, etc, are all using absolute links and I’m, say, on a plane (that doesn’t have reliable wifi) or otherwise somewhere that I can’t get online, I can’t do any work because the CSS, scripts, assets, links, etc, all will end up being broken unless I modify my host file to force the Stage URL to be my Local url—which is a really hamfisted way to have to do it.
The easy answer is—don’t like the convention? don’t do it. I get that… but my question isn’t what do I do about it (I already know what I can do about it). My question is WHY is this the convention? What is the rationale Ellis Labs (or the community as a whole) uses to justify this—other than that, well, the {site_url} global variable is there, so lets just use it everywhere, yahey!
(Note, I asked Boyink when he came to do a class at my company some weeks ago, and *I believe* he said something about making the site more portable because you can change the URL in the configuration—that answer doesn’t work for me for the obvious reason that NOT using the site_url value for everything means it’s domain agnostic and therefore fully portable without needed any configuration changes at all. At the very least, this is extra bytes on the page that are unnecessary…)
Thanks!