---
url: /api/symbols/workbox-swkit/precaching/precacheroute.md
---

# PrecacheRoute

Class @vite-pwa/workbox-swkit/precaching

A subclass of workbox-routing.Route that takes a
workbox-precaching.PrecacheController
instance and uses it to match incoming requests and handle fetching
responses from the precache.

## Constructor

```ts
new PrecacheRoute(precacheController: PrecacheController, options?: PrecacheRouteOptions)
```

**Parameters**

* `precacheController` – A `PrecacheController`
  instance used to both match requests and respond to fetch events.

* `options` – Options to control how requests are matched
  against the list of precached URLs.

## Properties

## Methods

### setCatchHandler()

```ts
setCatchHandler(handler: RouteHandler): void
```

**Parameters**

* `handler` – A callback
  function that returns a Promise resolving to a Response
