---
title: diskCapacity
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlcache/diskcapacity
---

# diskCapacity

The capacity of the on-disk cache, in bytes.

## Declaration

```swift
var diskCapacity: Int { get set }
```

## Mentioned in

Accessing cached data

## Discussion

Discussion When set, the on-disk cache will truncate its contents to the given size, if necessary.

## See Also

### Getting and setting on-disk cache properties

- [currentDiskUsage](foundation/urlcache/currentdiskusage.md)
