Get inspired at ContentCon. Learn more and register today
Get inspired at ContentCon. Learn more and register today
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.
/
  1. Home
  2. APIs
  3. Analytics API
  4. Cache Usage

Cache Usage

markdownView as Markdown

Cache Usage

GEThttps://app.contentstack.com/analytics/v2/hit-miss-ratio?orgUid={organization_uid}&services={["cdn","cma"]}&from={YYYY-MM-DD}&duration={duration}&to={YYYY-MM-DD}

The Cache Usage request will show the number of HIT/MISS instances for your cache. Number of HIT indicates that responses were received from the cache and MISS indicates the number of responses retrieved from the database.

Here’s how your response body would look like when you pass the jobId in the Retrieve Data endpoint.

{
    "data": [
        {
            "count": 7,
            "type": "cdn",
            "status": "MISS",
            "date": "2024-02-09"
        },
        {
            "count": 1,
            "type": "cdn",
            "status": "HIT",
            "date": "2024-02-08"
        },
        {
            "count": 2,
            "type": "cdn",
            "status": "MISS",
            "date": "2024-02-15"
        },
        {
            "count": 2,
            "type": "cdn",
            "status": "MISS",
            "date": "2024-02-08"
        },
        {
            "count": 4,
            "type": "cdn",
            "status": "MISS",
            "date": "2024-02-12"
        }
    ],
    "meta": {
        "orgUid": "blt**************87",
        "services": "[\"cdn\",\"cma\"]",
        "from": "2024-01-31",
        "duration": "day",
        "to": "2024-03-31"
    },
    "uid": "0f****46-5ee9-4f38-9146-1f********8"
}

The response body provides insights into how effectively the cache is being utilized for the specified services. Here’s a breakdown of the key elements:

  • count: The number of instances for the specified cache status (HIT or MISS).
  • type: The service type (e.g., "cdn") being tracked for cache usage.
  • status: Indicates whether the cache request was a "HIT" (response received from cache) or "MISS" (response retrieved from the database).
  • date: The date when the cache status was recorded.

This information helps analyze cache efficiency by detailing the number of HITs and MISSes, aiding in optimizing the cache strategy and understanding cache utilization.

Sample Response
Status|200 OK
1234
{
    "jobId": "job_7******a-c**f-4**9-9**0-c**********6",
    "paginated": false
}
Hide Parameters

Query Parameters

orgUidrequiredstring

Enter the UID of your Organization.

Example:

your_organization_uid
fromrequiredstring

Specify the start date for the required data. Use the following date format: YYYY-MM-DD. It cannot be in the future.

Example:

2024-01-31
durationoptionalstring

Determines the granularity of the data. Accepted values are sec, minute, hour, day, week, month, year, and historic; any other value returns a 400 error. If you omit duration, the response is not broken down by date.

Example:

day
torequiredstring

Enter the end date for the required data. The date format should be: YYYY-MM-DD. It must be on or after the from date and cannot be in the future.

Example:

2024-03-31
servicesrequiredstring

Specify the array of services for which you want statistics, such as: ["cma", "ui", "cdn", "graphql", "images", "assets", "automations", "launch", "cs-assets"]. Pass either a JSON array of service names, for example ["cdn","cma"], or a single service name on its own, for example automations. A comma-separated list is not supported and returns no data.

Example:

["cdn","cma"]
apiKeyoptionalstring

Enter your stack API key to get data for that specific stack.

Example:

your_stack_api_key
cacheoptionalstring

Enter HIT to return only cached responses, MISS to return only responses served from the database, or all to return both. Any other value returns a 400 error.

Example:

HIT
space_uidoptionalstring

Enter a space UID to filter the response to that space, or all to include every space. The value is not case-sensitive. Only available when services is set to cs-assets on its own — passing it alongside any other service returns a 400 error.

Example:

all
subServiceoptionalstring

Enter all, delivery-api, or management-api to filter the response to one part of the cs-assets service. The value is not case-sensitive; any other value returns a 400 error. Defaults to all. Like space_uid, it can only be used when services is set to cs-assets on its own.

Example:

all

Headers

authtokenrequiredstring

Enter your authtoken.

Example:

your_authtoken