Should Your Domain Include WWW?
Why did you get a slow load time with apple.com, but www.apple.com loaded quickly? Find out why, and find out if you should be including WWW in your domain.
Join the DZone community and get the full member experience.Join For Free
we operate in an industry where most of the people who work in development, engineering, it operations, etc. optimize their sites to death, trying to squeeze every millisecond out of their load times. yet sometimes, techniques that are staring us right in the face go unnoticed.
recently, as i was trying to buy a new shiny gadget, i just typed apple.com in my browser bar and was met with an extremely slow load time. i told myself my cable modem must be acting up, so i rebooted. but that did not change anything.
then i typed www.apple.com and then i got the speed i expected.
to find out why, let’s see what ip address apple.com points us to using the dig tool:
now let’s look at the dig for www.apple.com:
as you can see, the www domain is configured to point to akamai, whereas the non-www one is pointed to apple’s internal servers. when you set up your domain, you have to give the root (i.e. catchpoint.com) to an a record.
what’s the impact when this isn’t done? in the case of apple, it’s huge – about six times slower.
but apple is hardly alone here. we surveyed 1,000 of the top internet domains. out of those 1,000, a little over half (513, to be precise) had both the www and non-www domains point to the same ip address. that means that 487 domains configured them differently, thus potentially giving a different user experience.
the main reason for this difference is the complexity involved with setting up such a configuration so that it works with your dns, web servers, and cdns. sadly, it hasn’t gotten any easier in recent years, and so most companies resolve the issue through a 301 or 302 redirect. however, not only is this method slower, but it also adds risk because people forget to monitor the redirects.
this issue becomes even more relevant due to the increase of mobile usage. no one types www. into the browser on their phone – a behavior that has extended to desktop browsing as well – but the ultimate price is a slower user experience. additionally, mobile browsers and even microsoft edge automatically hides www., thus reinforcing on the user the idea of “domain.com” without the prefix:
as we’ve said before, performance is about more than just speed – it’s also about reliability and consistency. given that many companies don’t bother to include the www. prefix when listing or advertising their site, most users don’t even know that including it or not including it could have any effect on their experience.
Published at DZone with permission of Mehdi Daoudi, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.