# Clear App Cache

{% 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="ES5+" %}

```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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.webtonative.com/javascript-apis/clear-app-cache-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
