---
title: shared
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/urlcache/shared
---

# shared

The shared URL cache instance.

## Declaration

```swift
class var shared: URLCache { get set }
```

## Mentioned in

Accessing cached data

## Discussion

Discussion If your app doesn’t have special caching requirements or constraints, the default shared cache instance should be acceptable. Alternatively, you can create a custom URLCache object and set it as the shared cache instance (use +[NSURLCache setSharedURLCache] in Objective-C). You should do so before making any calls to this method.

## See Also

### Related Documentation

- [Accessing cached data](foundation/accessing-cached-data.md)
