# Azion CLI warmup

The Azion CLI `warmup` command warms the cache of a site. It starts at a base URL, follows the links each page carries, and requests every URL it finds, so the content is in Azion's cache before visitors ask for it. The options every command accepts, such as `--format`, `--out`, and `-y`, are on [Global options](/en/documentation/devtools/cli/globals/).

---

## Usage

`azion warmup` crawls the site from the URL you pass in `--url`:

```bash
azion warmup [flags]
```

| Flag               | Short | Type   | Default | Description                                                                                                                                                                                                |
| ------------------ | ----- | ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--max-concurrent` | —     | int    | `2`     | Maximum number of requests the command sends at the same time.                                                                                                                                             |
| `--max-urls`       | —     | int    | `1500`  | Maximum number of URLs the command processes in one run.                                                                                                                                                   |
| `--timeout`        | —     | int    | `8000`  | Time, in milliseconds, that the command waits for each request.                                                                                                                                            |
| `--url`            | —     | string | —       | **Required**. Base URL where the crawl starts, with its scheme, such as `https://example.com`. The URL can carry a path, such as `https://example.com/products`. Without it, the command asks for the URL. |

The command requests the base URL first, reads the links on each page it receives, and adds every new link to a queue. The crawl ends when the queue is empty or when the command reaches `--max-urls`. At the end, a summary counts the URLs that succeeded and the URLs that failed.

In `warmup`, `--timeout` counts milliseconds for each request. It takes the place of the global `--timeout` option, which counts seconds.

---

## Examples

Each example shows the command and the output it prints.

### Warm the cache of a site

This command crawls a site from its home page with the default limits:

```bash
azion warmup --url 'https://xxxxxxxxxx.map.azionedge.net/'
```

The command prints each URL it requests, the links it finds on that page, and a summary. In this example, the home page links to `about.html`, so the command requests both pages:

```text
Initializing cache warming...
Target site: https://xxxxxxxxxx.map.azionedge.net/
Configuration: 2 concurrent requests, max 1500 URLs
Request timeout: 8000ms

Processing batch: 1 URLs (0 remaining in queue)
[1/1500] /
  Found links: 1
  Examples:
    - about.html
Added to queue: 1 new URLs
Status: 1 processed | 1 queued | 0 failed

Processing batch: 1 URLs (0 remaining in queue)
[2/1500] about.html
Status: 2 processed | 0 queued | 0 failed

COMPLETED!
Processed: 2 URLs
Successful: 2
Failed: 0
Total time: 1.6s
Speed: 1.2 URLs/s
Cache warming completed successfully!
```

### Limit the crawl

This command processes at most 5 URLs, sends one request at a time, and waits up to 3,000 milliseconds for each request:

```bash
azion warmup --url 'https://xxxxxxxxxx.map.azionedge.net/' --max-urls 5 --max-concurrent 1 --timeout 3000
```

The output opens with the limits the command applies, then the same crawl as the example above:

```text
Initializing cache warming...
Target site: https://xxxxxxxxxx.map.azionedge.net/
Configuration: 1 concurrent requests, max 5 URLs
Request timeout: 3000ms

Processing batch: 1 URLs (0 remaining in queue)
[1/5] /
  Found links: 1
  Examples:
    - about.html
Added to queue: 1 new URLs
Status: 1 processed | 1 queued | 0 failed

Processing batch: 1 URLs (0 remaining in queue)
[2/5] about.html
Status: 2 processed | 0 queued | 0 failed

COMPLETED!
Processed: 2 URLs
Successful: 2
Failed: 0
Total time: 1.4s
Speed: 1.4 URLs/s
Cache warming completed successfully!
```

---

## Related resources

- [Global options](/en/documentation/devtools/cli/globals.md): The options every command accepts, including the global `--timeout` in seconds.
- [Azion CLI deploy](/en/documentation/devtools/cli/deploy.md): The command that deploys a site and prints the domain you then warm.
- [Azion CLI purge](/en/documentation/devtools/cli/purge.md): The command that removes content from the cache, such as a page you changed before you warm it again.
- [Expiration and freshness](/en/documentation/platform/applications/cache/expiration-and-freshness.md): How long a cached copy lives, and so how long a warmed page stays in the cache.
