<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WebBackForwardList/setPageCacheSize(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WebBackForwardList(im)setPageCacheSize:"
  },
  "title" : "setPageCacheSize(_:)"
}
-->

# setPageCacheSize(_:)

Sets the maximum number of pages the receiver can cache.

```
func setPageCacheSize(_ size: Int)
```

## Parameters

`size`

The maximum number of pages that can be cached.

## Discussion

The default page cache size can vary depending on the computer’s configuration. Use [`pageCacheSize()`](/documentation/WebKit/WebBackForwardList/pageCacheSize()) to get the current setting.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)