---
title: Debugging cache
related:
  - https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance/configuring-caching.md
  - https://docs.kentico.com/k10/custom-development/caching-in-custom-code.md
  - https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance/configuring-caching/setting-cache-dependencies.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

If you encounter unexpected caching behavior or any problems related to the cache, you can use the system's debugging functionality to:

- Check the exact content of the application's cache
- Monitor caching operations for web requests

You can access the system's debugging interface through the **Debug** application.

## Viewing the stored cache items

On the **Cache items** tab, you can see which **Data items** and **Dummy keys** ([cache dependencies](https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance/configuring-caching/setting-cache-dependencies.md)) are currently stored in the system's server-side cache.

![Viewing cache items](https://docs.kentico.com/docsassets/k10/debugging-cache/Cache_Item_Debug.png "Viewing cache items")

You can delete individual cache keys by clicking **Delete** () next to the corresponding items. To remove all items from the cache, click **Clear cache**.

Clicking **View** () next to a cache key opens a new window showing detailed information about the cached object:

- **Key** - the key under which the object is stored in the cache.
- **Expiration** - date and time when the cache item will expire (i.e. will be removed from the cache).
- **Priority** - Kentico uses two priorities for cache items: _High_ and _NotRemovable_ (will not be deleted from the cache as the server frees system memory).
- **Dependencies** - list of [dummy keys](https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance/configuring-caching/setting-cache-dependencies.md) on which the cache item depends. The system removes the cache item if any of the dummy keys are touched (modified).
- **Object type** - the type of the cached item.
- **Fields** - the fields storing the actual data of the cached item (depend on the item's object type).

![Viewing the details of a cache item](https://docs.kentico.com/docsassets/k10/debugging-cache/Cache_Item_Details.png "Viewing the details of a cache item")

If you need even more information about a cached object, click **Debug** () next to the item in the list of cache keys. Debugging cache keys allows you to browse the full system data of the given object, including all properties, variables and related objects.

> **Info:** **Note**: The list of cache items does not display the [partial output cache](https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance/configuring-caching/caching-page-output.md) stored for page components.

## Debugging cache access

The cache access debug allows you to view the cache operations that the system performs for individual web requests (adding items to the cache, loading data from the cache).

### Enabling the cache access debug

To use cache access debugging, you need to adjust the settings in **Settings -> System -> Debug**:

| Setting                                 | Description                                                                                                                                                                                                                                                                 |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enable cache access debug               | Enables cache access debugging and the **Cache access** tab in the **Debug** application.                                                                                                                                                                                   |
| Display cache access debug on live site | If enabled, cache access debug information is also displayed at the bottom of each page on the live site. Requires cache access debugging to be enabled.                                                                                                                    |
| Debug cache access of UI pages          | If enabled, the cache access debug also covers requests for pages of the administration interface. Requires cache access debugging to be enabled.                                                                                                                           |
| Cache access debug log length           | Sets the maximum length of the cache access debug log on the **Cache access** tab of the debugging interface, i.e. the number of requests for which debug information is preserved and displayed.<br>If empty, the value of the **Default log length** setting is used.     |
| Display stack information               | If enabled, the system tracks the code stack when debugging cache access and displays the information in the **Context** column.<br>This information is only available in the debugging UI and on the live site, not in the debug log written into the _logcache.log_ file. |
| Log cache access to file                | If enabled, the system saves the cache access debug log into the _logcache.log_ file in the _\~\App\_Data_ folder. This option does not require cache access debugging to be enabled.                                                                                       |

> **Tip:** **Tip**: You can also enable cache access debugging through the "debug everything" settings in the **All** section of the **Debug** settings category.

### Monitoring cache access

To view which cache operations the system performed for recent web requests:

1. Open the **Debug** application.
2. Select the **Cache access** tab.

You can see the URLs of web requests and the time when the system processed the requests. The table below each request contains the cache items that the system accessed during the request. The table provides the following information for each cache item:

- The type of **Access** (Get, Add)
- The name of the accessed **Cache key**
- The cache item's dependencies
- The object type and size of the cached **Data**
- The **Context** in which the cache item was accessed (API method)

  - Click on the method to see the stack trace of the cache access
  - If you enable the **Show complete context** option at the top of the interface, the stack trace is displayed for all cache items.

Click **Clear debug log** to remove all records in the cache access debug. To remove the actual data from the system's cache, click **Clear cache**.

![Debugging the system's cache access operations](https://docs.kentico.com/docsassets/k10/debugging-cache/Cache_Access_Debug.png "Debugging the system's cache access operations")

Clicking **View** () next to a cache key opens a new window showing detailed information about the cached object:

- **Key** - the key under which the object is stored in the cache
- **Expiration** - date and time when the cache item will expire (i.e. will be removed from the cache)
- **Priority** - Kentico uses two priorities for cache items: _High_ and _NotRemovable_ (will not be deleted from the cache as the server frees system memory)
- **Dependencies** - list of [dummy keys](https://docs.kentico.com/k10/configuring-kentico/optimizing-website-performance/configuring-caching/setting-cache-dependencies.md) on which the cache item depends. The system removes the cache item if any of the dummy keys are touched (modified).
- **Object type** - the type of the cached item
- **Fields** - the fields storing the actual cached data (different for each object type)
