NGINX HTTP Caches API

The HTTP Caches API from NGINX — 2 operation(s) for http caches.

Operations 3

GET /http/caches/ NGINX Return Status of All Caches #
GET /http/caches/{httpCacheZoneName} NGINX Return Status of a Cache #
DELETE /http/caches/{httpCacheZoneName} NGINX Reset Cache Statistics #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nginx-http-caches-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

nginx-http-caches-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: '9.0'
  title: NGINX Plus REST HTTP Caches API
  description: NGINX Plus REST [API](https://nginx.org/en/docs/http/ngx_http_api_module.html) provides access to NGINX Plus status information, on-the-fly configuration of upstream servers and key-value pairs management for [http](https://nginx.org/en/docs/http/ngx_http_keyval_module.html) and [stream](https://nginx.org/en/docs/stream/ngx_stream_keyval_module.html).
servers:
- url: /api/9
tags:
- name: HTTP Caches
paths:
  /http/caches/:
    get:
      tags:
      - HTTP Caches
      summary: NGINX Return Status of All Caches
      description: Returns status of each cache configured by [proxy_cache_path](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_path) and other “<literal>*_cache_path</literal>” directives.
      operationId: getHttpCaches
      parameters:
      - name: fields
        in: query
        description: Limits which fields of cache zones will be output. If the “<literal>fields</literal>” value is empty, then only names of cache zones will be output.
        x-example: ''
        schema:
          type: string
      responses:
        '200':
          description: Success
          x-microcks-refs:
          - name: getHttpCaches200Example
            x-microcks-default: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NginxHTTPCachesMap'
              example:
                http-cache:
                  size: 530915328
                  max_size: 536870912
                  cold: false
                  hit:
                    responses: 254032
                    bytes: 6685627875
                  stale:
                    responses: 0
                    bytes: 0
                  updating:
                    responses: 0
                    bytes: 0
                  revalidated:
                    responses: 0
                    bytes: 0
                  miss:
                    responses: 1619201
                    bytes: 53841943822
                  expired:
                    responses: 45859
                    bytes: 1656847080
                    responses_written: 44992
                    bytes_written: 1641825173
                  bypass:
                    responses: 200187
                    bytes: 5510647548
                    responses_written: 200173
                    bytes_written: 44992
                frontend-cache:
                  size: 530915328
                  max_size: 536870912
                  cold: false
                  hit:
                    responses: 254032
                    bytes: 6685627875
                  stale:
                    responses: 0
                    bytes: 0
                  updating:
                    responses: 0
                    bytes: 0
                  revalidated:
                    responses: 0
                    bytes: 0
                  miss:
                    responses: 1619201
                    bytes: 53841943822
                  expired:
                    responses: 45859
                    bytes: 1656847080
                    responses_written: 44992
                    bytes_written: 1641825173
                  bypass:
                    responses: 200187
                    bytes: 5510647548
                    responses_written: 200173
                    bytes_written: 44992
        '404':
          description: Unknown version (*UnknownVersion*)
          x-microcks-refs:
          - name: getHttpCaches404Example
            x-microcks-default: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NginxError'
              example:
                error: {}
                request_id: example-request_id
                href: example-href
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /http/caches/{httpCacheZoneName}:
    parameters:
    - name: httpCacheZoneName
      in: path
      description: The name of the cache zone.
      required: true
      x-example: example_httpCacheZoneName
      schema:
        type: string
    get:
      tags:
      - HTTP Caches
      summary: NGINX Return Status of a Cache
      description: Returns status of a particular cache.
      operationId: getHttpCacheZone
      parameters:
      - name: fields
        in: query
        description: Limits which fields of the cache zone will be output.
        x-example: ''
        schema:
          type: string
      responses:
        '200':
          description: Success
          x-microcks-refs:
          - name: getHttpCacheZone200Example
            x-microcks-default: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NginxHTTPCache'
              example:
                size: 530915328
                max_size: 536870912
                cold: false
                hit:
                  responses: 254032
                  bytes: 6685627875
                stale:
                  responses: 0
                  bytes: 0
                updating:
                  responses: 0
                  bytes: 0
                revalidated:
                  responses: 0
                  bytes: 0
                miss:
                  responses: 1619201
                  bytes: 53841943822
                expired:
                  responses: 45859
                  bytes: 1656847080
                  responses_written: 44992
                  bytes_written: 1641825173
                bypass:
                  responses: 200187
                  bytes: 5510647548
                  responses_written: 200173
                  bytes_written: 44992
        '404':
          description: 'Cache not found (*CacheNotFound*),

            unknown version (*UnknownVersion*)

            '
          x-microcks-refs:
          - name: getHttpCacheZone404Example
            x-microcks-default: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NginxError'
              example:
                error: {}
                request_id: example-request_id
                href: example-href
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      tags:
      - HTTP Caches
      summary: NGINX Reset Cache Statistics
      description: Resets statistics of cache hits/misses in a particular cache zone.
      operationId: deleteHttpCacheZoneStat
      responses:
        '204':
          description: Success
        '404':
          description: 'Cache not found (*CacheNotFound*),

            unknown version (*UnknownVersion*)

            '
          x-microcks-refs:
          - name: deleteHttpCacheZoneStat404Example
            x-microcks-default: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NginxError'
              example:
                error: {}
                request_id: example-request_id
                href: example-href
        '405':
          description: Method disabled (*MethodDisabled*)
          x-microcks-refs:
          - name: deleteHttpCacheZoneStat405Example
            x-microcks-default: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NginxError'
              example:
                error: {}
                request_id: example-request_id
                href: example-href
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    NginxHTTPCache:
      title: HTTP Cache
      type: object
      properties:
        size:
          type: integer
          description: The current size of the cache.
          example: 0
        max_size:
          type: integer
          description: The limit on the maximum size of the cache specified in the configuration.
          example: 0
        cold:
          type: boolean
          description: A boolean value indicating whether the “cache loader” process is still loading data from disk into the cache.
          example: false
        hit:
          type: object
          properties:
            responses:
              type: integer
              description: The total number of <a href="https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_valid">valid</a> responses read from the cache.
              example: 1234567
            bytes:
              type: integer
              description: The total number of bytes read from the cache.
              example: 0
          example: {}
        stale:
          type: object
          properties:
            responses:
              type: integer
              description: The total number of expired responses read from the cache (see <a href="https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_use_stale">proxy_cache_use_stale</a> and other “<code>*_cache_use_stale</code>” directives).
              example: 1234567
            bytes:
              type: integer
              description: The total number of bytes read from the cache.
              example: 0
          example: {}
        updating:
          type: object
          properties:
            responses:
              type: integer
              description: The total number of expired responses read from the cache while responses were being updated (see <a href="https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_use_stale_updating">proxy_cache_use_stale</a> and other “<code>*_cache_use_stale</code>” directives).
              example: 1234567
            bytes:
              type: integer
              description: The total number of bytes read from the cache.
              example: 0
          example: {}
        revalidated:
          type: object
          properties:
            responses:
              type: integer
              description: The total number of expired and revalidated responses read from the cache (see <a href="https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_revalidate">proxy_cache_revalidate</a> and other “<code>*_cache_revalidate</code>” directives.
              example: 1234567
            bytes:
              type: integer
              description: The total number of bytes read from the cache.
              example: 0
          example: {}
        miss:
          type: object
          properties:
            responses:
              type: integer
              description: The total number of responses not found in the cache.
              example: 1234567
            bytes:
              type: integer
              description: The total number of bytes read from the proxied server.
              example: 0
            responses_written:
              type: integer
              description: The total number of responses written to the cache.
              example: 0
            bytes_written:
              type: integer
              description: The total number of bytes written to the cache.
              example: 0
          example: {}
        expired:
          type: object
          properties:
            responses:
              type: integer
              description: The total number of expired responses not taken from the cache.
              example: 1234567
            bytes:
              type: integer
              description: The total number of bytes read from the proxied server.
              example: 0
            responses_written:
              type: integer
              description: The total number of responses written to the cache.
              example: 0
            bytes_written:
              type: integer
              description: The total number of bytes written to the cache.
              example: 0
          example: {}
        bypass:
          type: object
          properties:
            responses:
              type: integer
              description: The total number of responses not looked up in the cache due to the <a href="https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_bypass">proxy_cache_bypass</a> and other “<code>*_cache_bypass</code>” directives.
              example: 1234567
            bytes:
              type: integer
              description: The total number of bytes read from the proxied server.
              example: 0
            responses_written:
              type: integer
              description: The total number of responses written to the cache.
              example: 0
            bytes_written:
              type: integer
              description: The total number of bytes written to the cache.
              example: 0
          example: {}
      example:
        size: 530915328
        max_size: 536870912
        cold: false
        hit:
          responses: 254032
          bytes: 6685627875
        stale:
          responses: 0
          bytes: 0
        updating:
          responses: 0
          bytes: 0
        revalidated:
          responses: 0
          bytes: 0
        miss:
          responses: 1619201
          bytes: 53841943822
        expired:
          responses: 45859
          bytes: 1656847080
          responses_written: 44992
          bytes_written: 1641825173
        bypass:
          responses: 200187
          bytes: 5510647548
          responses_written: 200173
          bytes_written: 44992
    NginxHTTPCachesMap:
      title: HTTP Caches
      description: "Status information of all HTTP caches configured by \n<a href=\"https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_path\">proxy_cache_path</a>\nand other “<code>*_cache_path</code>” directives.\n"
      type: object
      additionalProperties:
        $ref: '#/components/schemas/NginxHTTPCache'
      example:
        http-cache:
          size: 530915328
          max_size: 536870912
          cold: false
          hit:
            responses: 254032
            bytes: 6685627875
          stale:
            responses: 0
            bytes: 0
          updating:
            responses: 0
            bytes: 0
          revalidated:
            responses: 0
            bytes: 0
          miss:
            responses: 1619201
            bytes: 53841943822
          expired:
            responses: 45859
            bytes: 1656847080
            responses_written: 44992
            bytes_written: 1641825173
          bypass:
            responses: 200187
            bytes: 5510647548
            responses_written: 200173
            bytes_written: 44992
        frontend-cache:
          size: 530915328
          max_size: 536870912
          cold: false
          hit:
            responses: 254032
            bytes: 6685627875
          stale:
            responses: 0
            bytes: 0
          updating:
            responses: 0
            bytes: 0
          revalidated:
            responses: 0
            bytes: 0
          miss:
            responses: 1619201
            bytes: 53841943822
          expired:
            responses: 45859
            bytes: 1656847080
            responses_written: 44992
            bytes_written: 1641825173
          bypass:
            responses: 200187
            bytes: 5510647548
            responses_written: 200173
            bytes_written: 44992
    NginxError:
      title: Error
      description: 'nginx error object.

        '
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              type: integer
              description: HTTP error code.
              example: 200
            text:
              type: string
              description: Error description.
              example: example-text
            code:
              type: string
              description: Internal nginx error code.
              example: 200
          example: {}
        request_id:
          type: string
          description: The ID of the request, equals the value of the <a href="https://nginx.org/en/docs/http/ngx_http_core_module.html#var_request_id">$request_id</a> variable.
          example: example-request_id
        href:
          type: string
          description: Link to reference documentation.
          example: example-href