---
title: "Cache / SetCacheViewHelper"
manual: "maps2 (Maps2)"
version: "13.1"
source: "AdministratorManual/Template/ViewHelpers/Cache/SetCacheViewHelper.rst"
rendered: "2026-10-01T12:50:05+00:00"
---

# Cache / SetCacheViewHelper {#viewhelper-set-cache}

This is a ViewHelper to set a new cache entry.

## General properties {#viewhelper-set-properties}

-   **prefix**

    -   *Type:* string

    If you want you can define a prefix for the generated CacheIdentifier. Leave
    this value empty to use "infoWindow" as default value

-   **poiCollection**

    -   *Type:* PoiCollection
    -   *Required:* true

    You must assign the PoiCollection object to this ViewHelper. We extract some
    data from PoiCollection to build a more unique CacheIdentifier which can differ
    Caches in multilingual environment.

-   **data**

    -   *Type:* string
    -   *Required:* true

    The data as string which has to be stored.

-   **tags**

    -   *Type:* array

    You can define some additional CacheEntryTags if you want. By default we add
    two additional Cache Tags named `infoWindowUid{PoiCollectionUid}` and
    `infoWindowPid{PoiCollectionPid}`

-   **lifetime**

    -   *Type:* int

    How long (in seconds) the CacheEntry should be available, before it will be
    re-generated? Keep this value empty to use the Default Value of Storage-Backend.
    0 for unlimited.

## Examples {#viewhelper-set-cache-examples}

### Basic example {#viewhelper-set-cache-basic-example}

```html
{maps2:cache.setCache(poiCollection: poiCollection, data: '{content->f:format.raw()}')}
```
