Deployment guides - Zeit Now

Last year we learned that stale-while-revalidate is the best cache technique for this type of architecture. At that moment, only KeyCDN and StackPath supported it.

We got in contact with Now because it didn’t work with their CDN. It looks like they have finally fixed it:

They call it “Serverless Pre-Rendering” but I think we should stick to the real name, stale-while-revalidate.

Anyway, I think that our first deployment guide could be Now because it’s serverless, it’s cheap and it’s easy to set up. For what I see, their CDN works now on external domains as well.


These are the instructions to deploy in Zeit Now:

  1. Install the now package in your project:
npm install --save-dev now
  1. Add this now.json file:
  "version": 2,
  "alias": [""], // CHANGE THIS!
  "builds": [
      "src": "build/static/*",
      "use": "@now/static"
      "src": "favicon.ico",
      "use": "@now/static"
      "src": "build/server.js",
      "use": "@now/node"
  "routes": [
      "src": "/static/(.*)",
      "headers": {
        "cache-control": "max-age=31536000,s-maxage=31536000,immutable"
      "dest": "/build/static/$1"
    { "src": "/favicon.ico", "dest": "/favicon.ico" },
      "src": "/(.*)",
      "headers": { "cache-control": "s-maxage=1,stale-while-revalidate" },
      "dest": "/build/server.js"
  1. Add a CNAME of to in your domain DNS settings.

  2. Deploy Frontity using this command

npx frontity build && npx now --target production

@SantosGuillamot do you feel like doing a guide with this in the docs? :slight_smile:

Sure! I will try to have a first version of the installations (Where should we include the architecture needed to use Frontity and WordPress?) & deploy during this week. I’ll tell you when it is finished and I may need some feedback :grin:

Sure, whatever you need :slight_smile:

I have made the first version of this guide of how to deploy Frontity on Now. @luisherranz When you have some time, could you take a look at it to check if everything makes sense please? :pray:

1 Like

Looks great to me :slight_smile:

2 posts were split to a new topic: Avoid SEO problems with multiple domains (like in Now)

Sorry I can’t understand …

I follow the steps indicated in this guide:

and the result is:

I had a Wordpress running …

Any suggestions?

According to the documentation:

  1. Point your main domain to Frontity, as it will be the domain your users will visit.
  2. Create a new subdomain for your admin dashboard, where you will access to edit your content. Using a subdomain will prevent you from buying a new one. You could use for example .

If the new url to edit the contents is

How is the URL of the Rest API? ?