# Caching

{% hint style="warning" %}
Available in Pro only.
{% endhint %}

Normally, when you load a map on the frontend, Wordpress has to assemble all the posts along with all their metadata and send it to the user. Then the user receives this, and the response is parsed and the geographies loaded onto the map.

The heaviest part of this — the part that slows down loading the most — is the work Wordpress has to do in order to assemble and query all the geographies. If you have hundreds or thousands of geographies, this can take more than a few seconds, especially if you have a lot of metadata too.

**The cache** works by generating this response one time, and then placing it into a static file in your **Uploads** folder. This file is then returned instantly whenever your map is loaded. This means the response time only requires the user to load the file and have it parsed.

If the file is large — with many thousands of complex polygons, for instance — the time could still be slow, but it will be many times faster than Wordpress querying it.

### Downsides to Caching

When you cache, it generates a static file of your map *at that moment*. That means that any new geographies you add, or any changes you make to existing geographies or map settings, won't be automatically included.

When you make these changes, remember to come back to the Cache section and press "Refresh Cached Response" in order to update that static file.

### How to Use Caching

Turn on Use Cache and then press Generate Cache Response. Once it's done, then you are now using a cached file!


---

# 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://wpmaps-docs.mapster.me/maps/developer/caching.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.
