# Caching

### Webhooks

TheShop uses a pulling system (webhooks) to inform the fronstore about a content change. For each action, you can set up this webhook in settings.

After the webhook URL for your frontstore is present, and changes in administration were made, TheShop sends a request to defined webhook URL.

For example, `theshopdev/frontstore` uses `Cache::rememberForever` method to cache static content, so homepage categories are cached forever to reduce API loads.

### Frontstore

On the frontstore side, there is a route called `/reset-cache`, which, by default, accepts a token parameter that you can set up anyhow you want – in `.env` file, it is provided as `CACHE_RESET_TOKEN`, to keep this channel secured.

This route checks for a token. If an incoming webhook contains a valid token, cache on the frontstore is flushed. If it does not contain a valid token, the response to server is `400 - Bad request`.

This endpoint is a basic implementation and you can develop it in your on way. For example, flush only desired contents based on the webhooks you define.


---

# 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://wiki.theshop.dev/docs/frontstore/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.
