> For the complete documentation index, see [llms.txt](https://interactiveboard.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://interactiveboard.gitbook.io/docs/objects/general-information/cache-behavior.md).

# Cache Behavior

Various objects cache expensive to compute/fetch data (**image**, **gif**, **skin\_3d**, **head\_3d**, **etc.**) for better performance and reduced memory consumption. However, in cases where the data being cached is unique, local caching is a better solution. If the unique cached data (like per player images) accumulates in cache over time, it will result in high memory consumption.&#x20;

**Cache Behavior Modes**

* **Global**
  * Best option for static data, like image or gif files, or other data that is used commonly.
  * Only gets cleared when [/**ib reload**](/docs/getting-started/commands-and-permissions.md#commands) is executed.
* **View**
  * Best option for unique/dynamic data, that would not be reused after the player leaves.
  * Gets cleared together with the board view getting cleared. The exact behavior of this depends on the **reset-radius-on-exit** ([General](/docs/board-settings/general.md)) setting. If **reset-radius-on-exit** is set to true, the cache will get cleared as soon as the player exits the radius of the board. If it is set to false, the cache will clear after the player leaves the server.

Every board object that stores data has the `cache-behavior:` setting.

{% tabs %}
{% tab title="Locally cached image" %}

```yaml
## image1 is an example of a dynamically fetched image.
## Since the image is unique to each player in this example, it is important 
## that the image is cleared from cache after the player leaves the server.
image1:
  type: image
  size: 512 512
  ## the cache behavior setting (global, view)
  ## in this case set to view (global is the default)
  cache-behavior: view
  image:
    ## example image URL that is unique to each player
    name: 'https://example.com/statistics/%player_name%/summary-image.png'
```

{% endtab %}
{% endtabs %}
