---
schema_version: "1"
id: 01ce76b8c83227ac3a6c0c306e6815e07478a558ddee6b2a6ebd1f671f212f5f
title: Refresh Records Cached in Durable Store While Offline
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/mobile-offline/guides/mobile-offline/apex/apex-refresh-cached-records.md
canonical_url: https://developer.salesforce.com/docs/platform/mobile-offline/guide/apex-refresh-cached-records.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5d33b1bfbb19a832880b3898360ae5b91624d4544fbada9bbce7f1e57d3af774
products:
  - Mobile and Offline Developer Guide
  - Platform Developer Content
---

# Refresh Records Cached in Durable Store While Offline

While it’s not possible to retrieve updated data from Salesforce while a client device is offline, it’s still possible to request updates when data is known to be stale.

For example, after updating a record via imperative Apex, you would want any version of that record cached by LDS to be updated. It’s straightforward to write code that handles this process when your imperative Apex succeeds while online, but also handles an update error if the client device is offline.

`getRecordNotifyChange()` is used to advertise the need to update cached records that were modified by imperative Apex. It isn’t supported at this time. Note that `getRecordNotifyChange(recordIds)` simply _notifies_ LDS that the records represented by `recordIds` provided in the function call are known to be stale. It doesn’t _share_ updated record values with LDS, even if those records are available offline. It’s the responsibility of LDS to retrieve the latest values for those records. LDS can only do so when the client is online.

`refreshApex()` is used to request a refresh for data provisioned by an Apex `@wire`. It’s usable today and, while online, behaves as expected. However, while `refreshApex(valueProvisionedByApexWireService)` can be called while offline, it requires a network connection to actually succeed, and push a new value to the wired property or function.

Using `getRecordNotifyChange()` and `refreshApex()` to request updates for cached data that are possibly stale is described in [Client-Side Caching of Apex Method Results](https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.apex_result_caching) in the _Lightning Web Components Developer Guide_.

**See Also**

- [_Lightning Web Components Developer Guide:_ Client-Side Caching of Apex Method Results](https://developer.salesforce.com/docs/platform/lwc/guide/apex-result-caching.html)
- [_Lightning Web Components Developer Guide:_ `@salesforce/apex` in `@salesforce` Modules](https://developer.salesforce.com/docs/platform/lwc/guide/reference-salesforce-modules.html)
