You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 15, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: guides/caching.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ The `cache` function can be used in the same route as other functions such as `s
59
59
- Value of `accept-encoding` request header
60
60
- Name of the destination when [split testing](./split_testing) is in effect
61
61
62
-
When [POST and other non-GET/HEAD](#section_caching_responses_for_post_and_other_non_get_head_requests) methods caching is enabled XDN automatically adds the following to the cache key:
62
+
When [POST and other non-GET/HEAD](#section_caching_responses_for_post_and_other_non_get_head_requests) methods caching is enabled, {{ PRODUCT_NAME }} automatically adds the following to the cache key:
63
63
64
64
- Request HTTP method
65
65
- Request body
@@ -145,7 +145,7 @@ This will automatically add request method and body to the caching key.
145
145
There are a number of limitations in caching of `POST` and similar requests:
146
146
147
147
1. If the request body is longer than 8,000 bytes, the caching will automatically be turned off.
148
-
2. Since both mutating and non-mutating requests are executed on the same route, there is no way for XDN to distinguish between such operations and the responsibility for never caching the mutating requests lies with you as the developer. The way to avoid caching responses to mutating requests is to inject `private` into `cache-control` of your response (e.g. `res.setHeader('cache-control', 'private')`)
148
+
2. Since both mutating and non-mutating requests are executed on the same route, there is no way for {{ PRODUCT_NAME }} to distinguish between such operations and the responsibility for never caching the mutating requests lies with you as the developer. The way to avoid caching responses to mutating requests is to inject `private` into `cache-control` of your response (e.g. `res.setHeader('cache-control', 'private')`)
149
149
3. Multiple requests are often need to "warm" the cache for non-`GET` requests.
150
150
151
151
### Caching Private Responses
@@ -299,7 +299,7 @@ If you have [static prerendering] enabled, the cache will automatically be repop
299
299
300
300
## Preserving the cache when deploying a new version of your site
301
301
302
-
By default, XDN clears your environment edge cache on every time you deploy a new version of your site.
302
+
By default, {{ PRODUCT_NAME }} clears your environment edge cache on every time you deploy a new version of your site.
303
303
304
304
This behavior can be turned off by editing your [Environment](environment) config and enabling the following option:
305
305
@@ -312,7 +312,7 @@ After activating that new environment version, future deploys will re-use the ex
312
312
In order to ensure that users who are actively browsing your site do not experience issues during a deployment, developers can
313
313
configure certain client-side assets to be permanently available, even after a new version of the site has been deployed. For example,
314
314
browsers using on an old version of the site may continue to request JavaScript chunks for the old version of the site for some time after a new
315
-
version is deployed. The XDN automatically makes client-side scripts permanently available if you use Next.js, Nuxt.js, Angular, or Sapper.
315
+
version is deployed. {{ PRODUCT_NAME }} automatically makes client-side scripts permanently available if you use Next.js, Nuxt.js, Angular, or Sapper.
316
316
317
317
If you are using another framework or would like to make sure a particular asset is permanently available, you can do so by setting the `permanent` option in `serveStatic`. For example:
318
318
@@ -343,11 +343,11 @@ These scripts assume that you have created environments called "production", "st
Copy file name to clipboardExpand all lines: guides/connectors.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Connector packages help build and run your app within {{ PRODUCT_NAME }}. When y
4
4
5
5
## Writing a connector
6
6
7
-
An XDN connector consists of four entry points:
7
+
A {{ PRODUCT_NAME }} connector consists of four entry points:
8
8
9
9
-`init.js` - Called when the user runs `xdn init`, adding resources to the project necessary for deploying on {{ PRODUCT_NAME }}. May also modify existing files with the project.
10
10
-`dev.js` - Called when the user runs `xdn dev` to run their app in development mode.
The XDN runs your application in its serverless cloud by proxying requests to your framework's application server, which it expects to be running on a specific port. The prod.js entry point exports a function that is called when a new serverless function is provisioned. It is responsible for starting your app on the provided port so that it can receive requests from {{ PRODUCT_NAME }}.
125
+
{{ PRODUCT_NAME }} runs your application in its serverless cloud by proxying requests to your framework's application server, which it expects to be running on a specific port. The prod.js entry point exports a function that is called when a new serverless function is provisioned. It is responsible for starting your app on the provided port so that it can receive requests from {{ PRODUCT_NAME }}.
126
126
127
127
_Optional. This entry point is only needed if your app uses server-side rendering or calls the_[renderWithApp](/docs/api/core/classes/_router_responsewriter_.responsewriter.html#renderwithapp)_method on ResponseWriter._
Copy file name to clipboardExpand all lines: guides/contributing.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Contributing to developer.moovweb.com
2
2
3
-
The XDN is all about putting power in the hands of developers and our documentation is no different. The source code for the {{ PRODUCT_NAME }} developer docs (i.e. this site your reading now) is in an open [repository on Github](https://github.com/moovweb-docs/xdn-docs) and we welcome feedback and pull requests. If you've found a typo or a better way to explain something, please submit a pull request or a file issue! Others will likely stumble over the same problem and benefit from your insight.
3
+
{{ PRODUCT_NAME }} is all about putting power in the hands of developers and our documentation is no different. The source code for the {{ PRODUCT_NAME }} developer docs (i.e. this site your reading now) is in an open [repository on Github](https://github.com/moovweb-docs/xdn-docs) and we welcome feedback and pull requests. If you've found a typo or a better way to explain something, please submit a pull request or a file issue! Others will likely stumble over the same problem and benefit from your insight.
4
4
5
5
## Running locally
6
6
@@ -27,7 +27,7 @@ Finally, visit the site in your browser at http://127.0.0.1:3000.
27
27
28
28
## Architecture
29
29
30
-
The XDN docs are a simple Next.js application running on {{ PRODUCT_NAME }} (yes we [dogfood](https://en.wikipedia.org/wiki/Eating_your_own_dog_food)). The content is stored as pages called "guides". Each guide is a Markdown file located in the [guides folder](https://github.com/moovweb-docs/xdn-docs/tree/master/guides) and the [guides.json](https://github.com/moovweb-docs/xdn-docs/blob/master/guides/guides.json) controls the navigation menu for reaching the guides.
30
+
{{ PRODUCT_NAME }} docs are a simple Next.js application running on {{ PRODUCT_NAME }} (yes we [dogfood](https://en.wikipedia.org/wiki/Eating_your_own_dog_food)). The content is stored as pages called "guides". Each guide is a Markdown file located in the [guides folder](https://github.com/moovweb-docs/xdn-docs/tree/master/guides) and the [guides.json](https://github.com/moovweb-docs/xdn-docs/blob/master/guides/guides.json) controls the navigation menu for reaching the guides.
Copy file name to clipboardExpand all lines: guides/migration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ To upgrade your project to XDN v2, run `xdn use latest`. XDN v2 introduces the f
6
6
7
7
### Path syntax change
8
8
9
-
The syntax for capturing multiple path tokens has been changed from `*variable` to `:variable*`. The XDN now uses [path-to-regexp](https://github.com/pillarjs/path-to-regexp) for route path matching, which is the same library used by express.
9
+
The syntax for capturing multiple path tokens has been changed from `*variable` to `:variable*`. {{ PRODUCT_NAME }} now uses [path-to-regexp](https://github.com/pillarjs/path-to-regexp) for route path matching, which is the same library used by express.
Copy file name to clipboardExpand all lines: guides/next.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,7 @@ Note that if you don't provide a `url` prop to `Prefetch`, you must specify the
165
165
166
166
## Routing
167
167
168
-
The XDN supports Next.js's built-in routing scheme for both page and api routes, including Next.js 9's clean dynamic routes. The default `routes.js` file created by `xdn init` sends all requests to Next.js via a fallback route:
168
+
{{ PRODUCT_NAME }} supports Next.js's built-in routing scheme for both page and api routes, including Next.js 9's clean dynamic routes. The default `routes.js` file created by `xdn init` sends all requests to Next.js via a fallback route:
169
169
170
170
```js
171
171
// This file was automatically added by xdn deploy.
@@ -255,7 +255,7 @@ module.exports = new Router()
255
255
256
256
### Dynamic Fallback Route
257
257
258
-
Usually Next.js requires 404.js to be a static page. The XDN enables you to render a specific page when no other route is matched using `router.fallback`:
258
+
Usually Next.js requires 404.js to be a static page. {{ PRODUCT_NAME }} enables you to render a specific page when no other route is matched using `router.fallback`:
Copy file name to clipboardExpand all lines: guides/nuxt.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,7 @@ Doing so will exclude these modules from your production deployment and keep the
147
147
## Routing
148
148
149
149
The next few sections of this guide explain how {{ PRODUCT_NAME }} interacts with Nuxt's routing, which is important if you are migrating an existing application. If you just created a new nuxt app, you can jump to [Running Locally](#section_running_locally) and come back to these sections later.
150
-
The XDN supports Nuxt.js's built-in routing scheme. The default `routes.js` file created by `xdn init` sends all requests to Nuxt.js via a fallback route:
150
+
{{ PRODUCT_NAME }} supports Nuxt.js's built-in routing scheme. The default `routes.js` file created by `xdn init` sends all requests to Nuxt.js via a fallback route:
151
151
152
152
```js
153
153
// This file was automatically added by xdn deploy.
@@ -262,11 +262,11 @@ The `Prefetch` component fetches data for the linked page from {{ PRODUCT_NAME }
262
262
263
263
## Static Sites
264
264
265
-
The XDN supports fully and partially static sites using Nuxt [generate](https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-generate). To deploy a static Nuxt site on {{ PRODUCT_NAME }}, simply set `target: 'static'` in `nuxt.config.js` and run `xdn deploy`. This will run `nuxt build` and `nuxt generate` to generate a static version of your site.
265
+
{{ PRODUCT_NAME }} supports fully and partially static sites using Nuxt [generate](https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-generate). To deploy a static Nuxt site on {{ PRODUCT_NAME }}, simply set `target: 'static'` in `nuxt.config.js` and run `xdn deploy`. This will run `nuxt build` and `nuxt generate` to generate a static version of your site.
266
266
267
267
### Incremental Static Rendering (ISG)
268
268
269
-
By default, requests for any pages that are not statically rendered at build time will fall back to server side rendering. If you use the {{ PRODUCT_NAME }} router to cache pages that are not statically rendered, the first user who attempts to access the page will see the fallback HTML page generated by Nuxt (200.html by default). The XDN will render and cache the HTML in the background so that subsequent visits result in a full HTML response. This behavior is similar to Next.js incremental static rendering (ISG). Here is an example route that adds caching for a partially static page:
269
+
By default, requests for any pages that are not statically rendered at build time will fall back to server side rendering. If you use the {{ PRODUCT_NAME }} router to cache pages that are not statically rendered, the first user who attempts to access the page will see the fallback HTML page generated by Nuxt (200.html by default). {{ PRODUCT_NAME }} will render and cache the HTML in the background so that subsequent visits result in a full HTML response. This behavior is similar to Next.js incremental static rendering (ISG). Here is an example route that adds caching for a partially static page:
// Requests for product pages that are not statically generated will fall back to SSR.
280
280
// The first user will see the 200.html loading page generated by Nuxt.
281
-
//The XDN will render full HTML response in the background and cache it for one hour at the edge.
281
+
//{{ PRODUCT_NAME }} will render full HTML response in the background and cache it for one hour at the edge.
282
282
// All future requests to the page will result in the full HTML response.
283
283
maxAgeSeconds:60*60*24,
284
284
staleWhileRevalidateSeconds:60*60, // continue to serve stale responses from the edge cache while refreshing via SSR in the background
@@ -290,7 +290,7 @@ export default new Router()
290
290
291
291
### Rendering a 404 Page
292
292
293
-
If you set the `fallback` property in the [generate](https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-generate/#fallback) config to `true`, Nuxt.js will generate a 404.html page that will be served whenever the URL does not match a static page. The XDN will send a 404 http status for these URLs. Note that if you set the fallback property to a string, Nuxt will generate a fallback page with that name, and {{ PRODUCT_NAME }} will serve it with a 200 http status when the URL does not match a statically generated page.
293
+
If you set the `fallback` property in the [generate](https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-generate/#fallback) config to `true`, Nuxt.js will generate a 404.html page that will be served whenever the URL does not match a static page. {{ PRODUCT_NAME }} will send a 404 http status for these URLs. Note that if you set the fallback property to a string, Nuxt will generate a fallback page with that name, and {{ PRODUCT_NAME }} will serve it with a 200 http status when the URL does not match a statically generated page.
Copy file name to clipboardExpand all lines: guides/overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,4 +66,4 @@ export default nextJSApp => {
66
66
67
67
## React, Vue, and Angular
68
68
69
-
{{ PRODUCT_NAME }} supports the most widely used technologies for building progressive web applications. The XDN CLI automatically detects whether you're using [React (Next.js)](next), [Vue (Nuxt.js)](nuxt), or [Angular](angular) and configures your app accordingly so you can publish your app to the cloud in seconds.
69
+
{{ PRODUCT_NAME }} supports the most widely used technologies for building progressive web applications. The {{ PRODUCT_NAME }} CLI automatically detects whether you're using [React (Next.js)](next), [Vue (Nuxt.js)](nuxt), or [Angular](angular) and configures your app accordingly so you can publish your app to the cloud in seconds.
The XDN also enables caching and prefetching of GraphQL requests via a middleware for [Apollo](https://www.apollographql.com/apollo-client). To enable prefetching of GraphQL queries in both the edge and the service worker:
294
+
{{ PRODUCT_NAME }} also enables caching and prefetching of GraphQL requests via a middleware for [Apollo](https://www.apollographql.com/apollo-client). To enable prefetching of GraphQL queries in both the edge and the service worker:
295
295
296
296
1. Ensure that your GraphQL API is configured to accept GET requests. The Apollo client uses POST requests by default, but the Apollo server [automatically accepts both GETs and POSTs](https://www.apollographql.com/docs/apollo-server/v1/requests/). We use GETs instead of POSTs for two reasons:
0 commit comments