# Cache Store

The Cache Store provides simple key/value cache storage. The Cache Store API can be accessed using `Platform.Server.CacheStore`.

* Cache Store is not durable. Data will be cleaned up if not used.
* The Cache Store API can only be used on the server.
* Cache Store is faster than Data Store.

Some common use cases for Cache Store are:

* Temporary Cooldowns on accessing content
* Share Codes for joining a match

{% hint style="info" %}
Cache Store is intended to be used for short-lived, non-durable key/value storage. If you need persistent storage without expiration times, checkout [Data Store](/platform-services/data-store.md).
{% endhint %}

## Common Patterns

```typescript
// Create a queue cooldown
await Platform.Server.CacheStore.SetKey(
    `BossQueue:${player.userId}`, // The key for this cache entry
    os.time(), // The time the cooldown was created is stored as the value
    60, // 60 second cooldown
);

// Check a queue cooldown
const result = await Platform.server.cacheStore.GetKey<number>(`BossQueue:${player.userId}`);
if (result) {
    // On cooldown
} else {
    // Not on cooldown
}
```


---

# 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.airship.gg/platform-services/cache-store.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.
