docs(misc): replace memoization with caching

This commit is contained in:
vsavkin 2021-05-18 13:42:22 -04:00
parent cbfbcd3755
commit f31b8cb023
3 changed files with 6 additions and 6 deletions

View File

@ -58,7 +58,7 @@ For example:
2. `workspaceRoot/apps/my-app/.env` contains `AUTH_URL=https://prod-url.com/auth`
3. Nx will first load the variables from `apps/my-app/.env.local` into the process. When it tries to load the variables from `apps/my-app/.env`, it will notice that `AUTH_URL` already exists, so it will ignore it.
We recommend nesting your **app** specific `env` files in `apps/your-app`, and creating workspace/root level `env` files for workspace-specific settings (like the [Nx Cloud token](/{{framework}}/core-concepts/computation-caching#nx-cloud-and-distributed-computation-memoization)).
We recommend nesting your **app** specific `env` files in `apps/your-app`, and creating workspace/root level `env` files for workspace-specific settings (like the [Nx Cloud token](/{{framework}}/core-concepts/computation-caching#nx-cloud-and-distributed-computation-caching)).
### Pointing to custom env files

View File

@ -116,9 +116,9 @@ Nx will also cache the files generated by a command. The list of folders is list
If the outputs property is missing, Nx will default to caching the appropriate folder in the dist (`dist/apps/myapp` for `myapp` and `dist/libs/somelib` for `somelib`).
## Local Computation Memoization
## Local Computation Caching
**Because the word "cache" appears in the description, the phrase "artifact caching" comes to mind. But this isn't the right way to think about it. What Nx does is computation memoization.** We can't choose to use or not use the cached value. There are no versions. It is transparent: Nx will skip the computation only when running the computation would have produced the same result.
**Because the word "cache" appears in the description, the phrase "artifact caching" comes to mind. But this isn't the right way to think about it. What Nx does is really computation memoization.** We can't choose to use or not use the cached value. There are no versions. It is transparent: Nx will skip the computation only when running the computation would have produced the same result.
By default, Nx uses a local computation cache. The cache is stored in `node_modules/.cache/nx`. You can change the directory as follows:
@ -149,7 +149,7 @@ nx build myapp --skip-nx-cache
nx affected:build --skip-nx-cache
```
## Nx Cloud and Distributed Computation Memoization
## Nx Cloud and Distributed Computation Caching
Nx Cloud is a SAAS product that allows you to share the results of running build/test with everyone else working in the same workspace. Learn more at [https://nx.app](https://nx.app).
@ -173,7 +173,7 @@ The `nx test shop` command, which in this case uses Jest, works similarly. The c
## Caching and Affected
In addition to the memoization, which works against the current state of the codebase and the environment, Nx also is able to look at the code change itself (e.g., PR), and figure out what can be broken by it, and only rebuild and retest what is affected. Why use both?
In addition to the caching, which works against the current state of the codebase and the environment, Nx also is able to look at the code change itself (e.g., PR), and figure out what can be broken by it, and only rebuild and retest what is affected. Why use both?
Affected and caching are used to solve the same problem: minimize the computation. But they do it differently, and the combination provides better results than one or the other.

View File

@ -175,7 +175,7 @@ Visit the [Nx Documentation](https://nx.dev) to learn more.
## ☁ Nx Cloud
### Computation Memoization in the Cloud
### Distributed Computation Caching & Distributed Task Execution
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-cloud-card.png"></p>