Our focus since the beginning has been on Global Deployment: your content and applications should live everywhere. There should be no frontiers placed on your ideas and your business.
To enable us to follow the path of our goal; we designed a platform that allows you to seamlessly run code everywhere whilst distributing and caching static content. All of this with an uncomplicated setup, advanced DNS configurations, and built-in GitHub Integration.
Today we are announcing our partnership with Cloudflare to expand our distribution layer to over 150 locations, while also leveraging their best-in-class DDoS protection.
Until now, when you pointed your domain to our zeit.world nameservers, we set up the records that point your domain to our origin servers by leveraging Anycast DNS.
With Now CDN enabled, we instead automatically configure the Cloudflare distribution network, seamlessly modify your DNS, and point all of your traffic to it. No setup or manual steps required.
If you have a static deployment, we automatically cache it everywhere in the world (no need to re-deploy). If your deployment is dynamic, you get full control via HTTP Caching Headers.
Every time you deploy, we give you a new unique *.now.sh URL. Here is the best part: as of today, the entire *.now.sh namespace is being served by our CDN layer.
This means that…
  • It's very easy to reproduce production conditions during development
  • All your intermediate deployments and preview links can leverage worldwide distribution
  • You have the fastest file sharing system in the world at your fingertips.

CDN-backed asset and file sharing. Hotlink and serve anything.

While CDN layers have typically provided a remarkable boost of performance, that has not come without a cost.
In particular, getting the right caching configuration can be quite tricky. Configuring headers, caching behavior, and overrides are not only difficult but can result in stale content being delivered to your end users.
Now gets around these problems with its simple immutable model. In the following example, we make a static deployment that gets automatically cached. When we run now alias, however, to assign a domain name to my deployment, we automatically purge the CDN cache.

`now alias` will purge the cache for any alias or domain so there's never stale content being served

The very website you are reading now is served from the edge. It's powered by React-based server-rendering for both static and dynamic pages.
Since it's a dynamic deployment, we configured the Cache-Control headers appropriately. As most of the content varies based on the logged-in state of the user, we don't send caching headers when the authentication cookie is set.
In order to bypass the cache, we have introduced a generic cookie you can set: _now_no_cache=1 (read more about this in the documentation. Our CDN layer will hit origin every time if it finds it in the Cookie header.

zeit.co caches when the user is not logged in.

Automatically configuring a CDN on your behalf involves numerous steps:
  • Issuing and synchronizing certificates
  • Observing the registration state of the CDN
  • Automatically flipping DNS records when all the preconditions are met
We are very happy that we can not only accomplish this, but we do so without any user intervention and without dropping a single request throughout the process.
But perhaps what's the most interesting is that this level of automation does not trade off the low-level access to the primitives that make this all work.
For example, my domain acme.com was a legacy domain added prior to the introduction of our CDN. This is what now dns ls acme.com looks like:
                              id  name  type   value                      aux  created
    rec_c182d5dbasra23b054876c34        ALIAS  alias.zeit.co.                  50ms ago
    rec_e769e57db2becf324bf8ef53  *     CNAME  alias.zeit.co.                  50ms ago
We have introduced the notion of default DNS records. For this domain, the default DNS records just point to our origin domain alias.zeit.co.
We are able to override any of these by simply adding new records via now dns add. If we enable the CDN for this domain, we'll then see that the default DNS records have changed:
                              id  name  type   value                      aux  created
    rec_dvu2e9b9b5c0471be1de34a7        ALIAS  alias.zeit-cdn.net.             41ms ago
    rec_e4942523e89b729dc9fbo66d  *     ALIAS  alias.zeit-cdn.net.             41ms ago
If I want, I could now introduce new records that bypass our zeit-cdn.net origin completely.
The same even applies to certificates. You can list the ones we auto-generate for you via now certs ls and even upload your own custom ones.
With the introduction of our CDN, we are making all domains backed by our network of origin nodes free and unlimited for all plans.
What does this mean?
  • You can now add unlimited domains and aliases for any static or dynamic deployment
  • Your deployments will be served from our growing set of origin regions, which automatically cache your responses just like our new CDN
However, only paid plans allow for enabling the CDN feature.
When adding a domain to any paid plan, the Now CDN will be automatically enabled for the domain going forward.
You can get a domain with us or you can add an externally registered domain to your account using now domains add [your domain].
If you have a domain already associated with your ZEIT account, you can enable the CDN using either the ZEIT website or Now CLI.
To enable the CDN from our website you will need to be logged in. Head to the dashboard of your account or the team that holds the domain you want to enable the CDN for, then head to the 'Domains' section of your dashboard. From here, you'll be able to simply click a checkbox to activate the CDN for any domain you want!

Enabling the CDN via zeit.co

Enabling the CDN for pre-existing domains on your account with the Now CLI is as simple as one command:
now domains add [your domain] --cdn
You can also use the --no-cdn flag to disable the CDN when adding a new domain or on existing domains.
Until today, your content could be cached at the edge only by our origin clusters in California and Brussels. Starting today, we are seamlessly expanding this to 150+ locations throughout the world, with the same ease and simplicity you are used to.
We think this is an important step in the evolution of our platform. This kind of seamless, zero-downtime platform upgrade embodies the core mission of our company: that you should be able to deploy without being hindered by servers or complicated administration.
With this in mind, we will continue to expand our network throughout the rest of 2018. We look forward to sharing more good news with you soon.