> For the complete documentation index, see [llms.txt](https://docs.webtonative.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.webtonative.com/javascript-apis/clear-app-cache-1.md).

# Clear App Cache API

{% hint style="info" %}
You'll need to import the javascript file in your website before starting from this [link](https://docs.webtonative.com/javascript-apis/getting-started).
{% endhint %}

To clear the cache when app is running.

{% tabs %}
{% tab title="Plain Javascript" %}

```javascript
window.WTN.clearAppCache(true);
```

Note :- If you want to reload the app after cache is cleared you can call the function with value true.

```javascript
window.WTN.clearAppData(true);
```

Note :- To clear app data call the above function.
{% endtab %}

{% tab title="npm" %}

```javascript
import { clearAppCache } from "webtonative";

clearAppCache(false);
```

Note :- If you want to reload the app after cache is cleared you can call the function as below.

```javascript
clearAppCache(true);
```

Note :- If you want to clear all stored app data (not just cache) you can call the function as below.

```javascript
clearAppData(true);
```

{% endtab %}
{% endtabs %}

Parameters:

| Key    | Type      | Description                                                                             |
| ------ | --------- | --------------------------------------------------------------------------------------- |
| Option | `Boolean` | If `true`, reloads the WebView after clearing. If `false`, the WebView is not reloaded. |

Feature released on Android on 15/08/2023\
Feature released on iOS on 01/03/2026\
Functions updated on Android and iOS on 19/05/26
