# Playwright browsers

Avrea caches the archives downloaded by `playwright install`. Repeat downloads
of the same browser revision and platform use the packages cache.

## On Avrea runners

When **Package Manager Cache** and **Playwright Browser Cache** are enabled,
Avrea configures:

```bash
PLAYWRIGHT_DOWNLOAD_HOST="https://cache.avrea.com:8443/playwright"
```

Use your normal install command:

```yaml
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npx playwright test
```

This covers Chromium (including Chrome for Testing and headless shell), Firefox,
WebKit, and Playwright's helper archives such as FFmpeg. Downloads are cached
automatically and reused across jobs.

## What is cached

Avrea caches browser download archives. Playwright extracts and installs them
on each fresh runner.

The Playwright npm package uses the [npm cache](/cache/packages/npm/).
Linux dependencies installed by `--with-deps` use the OS packages cache
when enabled.

## Enable or disable

**Playwright Browser Cache** (`cache.playwright-browsers.enabled`) is enabled by
default. Turn it on or off at the organization or repository level under
**Settings** in the [Avrea console](https://console.avrea.com). **Package Manager
Cache** (`cache.packages.enabled`) must also remain enabled.

Disable it for a repository with the CLI:

```bash
avr settings set cache.playwright-browsers.enabled false
```

Re-enable it:

```bash
avr settings set cache.playwright-browsers.enabled true
```

Reset to the inherited default:

```bash
avr settings reset cache.playwright-browsers.enabled
```

Repository overrides take precedence over organization settings. Changes apply
to new jobs. See [Managing caches](/cache/managing/#cache-settings).

## Overrides

Workflow or step environment variables can override `PLAYWRIGHT_DOWNLOAD_HOST`.
Playwright's `PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST`,
`PLAYWRIGHT_FIREFOX_DOWNLOAD_HOST`, and `PLAYWRIGHT_WEBKIT_DOWNLOAD_HOST` take
precedence for their respective browsers. See the
[Playwright artifact repository documentation](https://playwright.dev/docs/browsers#download-from-artifact-repository).

To use Playwright's default download hosts for a step, clear the general override
and any browser-specific overrides you configured:

```yaml
- run: npx playwright install chromium
  env:
    PLAYWRIGHT_DOWNLOAD_HOST: ""
```