## MedplumClient.getCached() method [​](/content/docs/sdk/core.medplumclient.getcached#medplumclientgetcached-method "Direct link to MedplumClient.getCached(/index.html) method")

Returns a cached resource if it is available.

**Signature:**

```typescript
getCached<RT extends ResourceType>(resourceType: RT, id: string): WithId<ExtractResource<RT>> | undefined;
```

## Parameters [​](/content/docs/sdk/core.medplumclient.getcached#parameters "Direct link to Parameters"/index.html)

| Parameter       | Type | Description                       |
| ---             | ---  | ---                               |
| resourceType   | RT   | The FHIR resource type.          |
| id              | string| The FHIR resource ID.            |

**Returns:**  
[WithId](/content/docs/sdk/core.withid) <ExtractResource<RT>> \| undefined

The resource if it is available in the cache; undefined otherwise.

- [MedplumClient.getCached() method](/content/docs/sdk/core.medplumclient.getcached#medplumclientgetcached-method/index.html)
- [Parameters](/content/docs/sdk/core.medplumclient.getcached#parameters/index.html)
