# GarnetResource.withPersistence

- Module: [Aspire.Hosting.Garnet](/reference/api/typescript/aspire.hosting.garnet.md)
- Defined on: [GarnetResource](/reference/api/typescript/aspire.hosting.garnet/garnetresource.md)
- Version: `13.4.0`
- Kind: `method`

Configures a Garnet container resource for persistence.

## Definition

```typescript
interface GarnetResource {
  // ... omitted for brevity
  withPersistence(interval?: timespan): GarnetResource;
}
```

## Signature

```typescript
withPersistence(interval?: timespan): GarnetResource
```

## Parameters

- `interval` (`timespan`) `optional`

## Returns

[GarnetResource](/reference/api/typescript/aspire.hosting.garnet/garnetresource.md) `builder`

## Defined on

- [GarnetResource](/reference/api/typescript/aspire.hosting.garnet/garnetresource.md) -- `handle`
