---
title: "`/cache` — conditional-request endpoint."
url: "https://developer.rucho.org/apis/rucho/versions/5bdf1bcb-8db4-40f1-a293-72c7198e26c8/operations/cache_handler"
---

> Full API specification: https://developer.rucho.org/apis/rucho/versions/5bdf1bcb-8db4-40f1-a293-72c7198e26c8.md

# `/cache` — conditional-request endpoint.

`GET` `/cache`

Operation ID: `cache_handler`

Returns `304 Not Modified` if the request carries `If-None-Match` or `If-Modified-Since`; otherwise `200` with `ETag` + `Last-Modified` headers and a JSON echo, so a client can revalidate on the next request.

## Responses

- `200` - Cacheable JSON echo with ETag + Last-Modified
- `304` - Not Modified — conditional request matched

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: rucho
  version: 1.6.0
servers:
  - url: https://rucho.org
    description: Production (EKS us-east-2, behind Kong)
paths:
  /cache:
    get:
      tags:
        - crate::routes::cache
      summary: "`/cache` — conditional-request endpoint."
      description: >-
        Returns `304 Not Modified` if the request carries `If-None-Match` or

        `If-Modified-Since`; otherwise `200` with `ETag` + `Last-Modified`
        headers

        and a JSON echo, so a client can revalidate on the next request.
      operationId: cache_handler
      responses:
        "200":
          description: Cacheable JSON echo with ETag + Last-Modified
        "304":
          description: Not Modified — conditional request matched
```
