5 ms·
The reasons given for using www are honestly very weak, just edge cases really. As far as cookies are concerned, keeping them on the origin ensures they get pa
by crazygringo 8y ago
The reasons given for using www are honestly very weak, just edge cases really.
As far as cookies are concerned, keeping them on the origin ensures they get passed to all subdomains, which is usually a benefit, as opposed to a problem -- which you'll discover when you need to restrict API requests on a subdomain only to logged-in users, for example. And as long as you're keeping your cookie payload small, like a session ID or two, there's zero worry about a performance hit.
And as far as a CNAME needing to point to another domain instead of an IP, has that ever been an issue for anyone? Genuinely curious. I'd never even heard of that until now.
Honestly, simpler is better and "www." is an unnecessary vestige from another era. I dropped it from my sites starting a couple years ago. (Obviously with a redirect in case anyone ever types it.)
- ericpauley 8y agoCNAME is absolutely an issue, especially when using managed hosting. Many hosts require that you CNAME since they move around IPs. (e.g. Heroku) so unless you put a provider in front of them that integrates with your DNS you need www.
- hacknat 8y agoYou can add AWS, Azure, and GCP to this list. Most people don’t want to lay out the money for a static IP, and why should they?
- yegle 8y agoNot true for App Engine: we have a fixed set of IP addresses to be used in A/AAAA record. Disclaimer I work on App Engine.
- hacknat 8y agoThis FAQ on App Engine specifically says you guys can’t map a static IP to a site: https://cloud.google.com/appengine/kb/ https://cloud.google.com/appengine/kb/
- stickfigure 8y agoThat is something different. If you want to run your app on a naked domain, they give you a set of A/AAA records you can use. Search in that same document for "naked domain".
- paralelogram 8y agoApp Engine uses four anycast IP addresses: https://www.bing.com/search?q=ip%3A216.239.32.21 https://www.bing.com/search?q=ip%3A216.239.32.21 https://www.bing.com/search?q=ip%3A216.239.34.21 https://www.bing.com/search?q=ip%3A216.239.34.21 https://www.bing.com/search?q=ip%3A216.239.36.21 https://www.bing.com/search?q=ip%3A216.239.36.21 https://www.bing.com/search?q=ip%3A216.239.38.21 https://www.bing.com/search?q=ip%3A216.239.38.21
- merb 8y agoyou should read before you write. > I'd like to map my app to a naked domain (such as http://example.com http://example.com). vs. > App Engine does not currently provide a way to map static IP addresses to an application the latter is that you own an IP and want to map it against your appengine. the former is example.com -> appengine site. (not related to google)
- gray_-_wolf 8y agoWe solved this by having cloudflare manage our dns and they offer something like "cname to ip".
- TheRealPomax 8y agoYou sidestepped it, rather than really solved it: you got rid of the CNAME issue by trading it for a proxy availability issue. It works--of course it works, it's literally why cloudflare exists--but now your service availability is directly tied to cloudflare's availability. And cloudflare glitches often enough that plenty of people run into their 5xx pages on a daily basis across the web. So you traded an intermittent problem (only relevant when an IP change occurs) for 24/7 guaranteed service outages for a (probably very) low percentage of your intended demographic.
- Dylan16807 8y ago"Now your service availability is tied to your DNS service's availability" is always true.
- amingilani 8y agoFor pretty much any DNS service you use.
- TheRealPomax 8y agoWould you like me to edit it so it says "Now your service availability is tied to not just the global DNS system that literally anything that wants to exist on the web with not just an IP but a named host relies on, but a secondary routing entity that sits on top of standard DNS and does fancy things"? Because I'm pretty sure we all know what I meant when I pointed out using Cloudflare means gaining a convenience at the expense of being at the mercy of third party outages.
- scoggs 8y agoIt could just be a stopgap in the meantime while they write the true solution? Just a thought.
- hacknat 8y agoCNAMEs can’t point to an IP, not sure what you even mean by that.
- tyingq 8y agoNetlify explains the issue in pretty good detail. https://www.netlify.com/blog/2017/02/28/to-www-or-not-www/ https://www.netlify.com/blog/2017/02/28/to-www-or-not-www/
- hacknat 8y agoWhat do you mean explains it? CNAMEs can’t point to IPs. This article doesn’t say otherwise. Also this article says you should use “www”.
- tyingq 8y agoThe post you replied to also said a CNAME can't point to an IP: "as far as a CNAME needing to point to another domain instead of an IP" So, it's unclear to me who you're arguing with. I thought a post explaining why using a CNAME on an "apex domain" is potentially problematic might be helpful. Guess not.
- gpvos 8y agoTo me, that sentence reads as that it's possible for a CNAME to point to an IP, but that someone has a need to point it to a domain. Which makes the sentence incorrect, since it assumes something impossible, and explains hacknat's urge to correct it.
- deleted 8y ago[deleted]
- koolba 8y agoCookies can be scoped to a parent domain. So www.example.com can scope it’s cookies to example.com and have them accessible to api.example.com.
- Audible_logic 8y agoAfter a few years at a registrar, my experience is it comes up quite often enough. It's rare that the person is concerned enough to change to a DNS provider that allows alias/ANAME records, but people do ask about it.
- calibas 8y agoSending session tokens to every subdomain, and also potentially leaking other sensitive data, is a pretty strong case in my opinion. Of course, this isn't something that has a concrete right and wrong answer. It's more a question of how much you trust your subdomains. Personally, I think sharing that information should be a conscious choice when setting the cookies and not something that you let happen by default.
- SlowRobotAhead 8y agoI agree. It doesn’t exactly seem like edge cases to not want to propagate front end cookies to internal services. IDK, seems like an issue with cookies just as much as www or no-www.
- toast0 8y agoIf you plan to use a CDN in front of your site at the Apex, it severely constrains your options. You either need to pick a CDN that only uses anycast, so you can plop in a staticy A record, or you need to delegate your domain to their nameservers so they can send different resolvers different records. Those aren't necessarily bad options, but it leaves out a lot of CDNs that either don't do anycast or do a mix of anycast and unicast, and it leaves out the possibility of using geodns to use one CDN in one region and another in other reasons. I'm a bit scale focused though. If your site is never going to need a CDN, you can of course pick aesthetics over serviceability. But if this is something you hope to one day get big, you might as well make an easy decision to prepare for it at the start. You will want to support any inbound links you get for as long of forever as possible, so it's nice if they are to the right hostname to start with.
- erikpukinskis 8y agoEdge cases are good reasons. In some cases a single edge case can be the reason to make a decision. If your attitude is “working in 99% of cases is good enough”, that means over a long enough period of use, 100% of your users will encounter an edge failure. The way to even have a shot at 99% of your users a good experience is to constantly let edge cases force your hand.
- fwip 8y agoOnly if edge cases are uniformly distributed, which is rarely the case.
- erikpukinskis 8y agoNo, they needn't be uniform.
- justinph 8y agoIf you run a high traffic website with geographic redundancy, being able to quickly switch your DNS is essential.
- PavlovsCat 8y agoBeing able to have cookies restricted to a subdomain is kinda one of my favourite things about subdomains. I just like the idea of requests being minimal, and when you have a lot of static public assets, you can put them on another subdomain without cookies. That no longer works if you have a lot of cookies on the origin, since those get sent always.
- sureaboutthis 8y agoWhat difference does it make if is written "www" or not? "www" is a subdomain like any other and works exactly the same.