GraphQL Edge Cache Statuses

The cache statuses in Stellate's GraphQL Edge Cache are indicators of how a request interacts with the cache. The status of each request can be found in the stellate-cache header in the response. Here's a rundown of each status:

Cache HIT

A diagram illustrating cache hit in Stellate

The request was served from the Edge Cache, and the data returned without reaching the origin server. This was made possible by matching the request to one or more rules and finding a previously cached response that meets the maxAge, swr, and scope settings.

Cache MISS

A diagram illustrating cache miss in Stellate

This status is returned when there is no cached data found for the request. This means the request had to be sent to the origin server to fetch the required data. After the first MISS, the fetched data is stored in the cache for subsequent requests, turning future MISSes into HITS.

Cache PASS

A diagram illustrating cache pass in Stellate

This status indicates that caching was prevented due to one of the passthrough reasons specified in the service config. As a result, Stellate did not try to find a cached version of the requested data and sent the request directly to the origin server.

Configuration Passthroughs

No matching rules found

There are no rules in the current config targeting this request.

An image presenting request with cache status of "pass" due to not maching cache rules

The cache rule(s) prevented caching

The following cache rule(s) prevented caching this request.

An image presenting request with cache status of "pass" due to cache rules

Matches Non-Cacheable List

A non-cacheable type or field in the request prevented caching this request.

An image presenting request with cache status of "pass" due to type being listed as non-cacheable

Request Passthrough Reasons

Specific characteristics of requests casuse them to bypass Stellate's cache and be forwarded to the origin server.

HTTP_METHOD

The HTTP_METHOD HTTP method used is not cacheable.

BODY_SIZE

The request body size exceeded the 40KB size limit for caching.

INVALID_JWT

There was an error while parsing the JWK or the the signature was invalid. This prevented caching this request

NO_APPLICATION_JSON

The request body was missing or was not application/json

WEBSOCKETS

WebSocket requests cannot be cached.

REQUEST_JSON_PARSE_ERROR

An error while parsing the request body as JSON prevented caching this request.

NO_REQUEST_BODY

Requests without body cannot be cached.

QUERY_PROPERTY_MISSING

A missing GraphQL query property prevented caching this request.

QUERY_PARSING_ERROR

An error while parsing the GraphQL query prevented caching this request.

BYPASS_CACHE_HEADER

The x-preview-token bypass header prevented caching this request.

RESPONSE_NO_OK

The HTTP/code response status code prevented caching this request.

RESPONSE_CONTENT_LENGTH_TOO_BIG

The size of the response body exceeded the 10MB size limit for caching.

RESPONSE_STREAM_TOO_BIG

The size of the response body exceeded the 10MB size limit for caching.

NO_CACHEABLE_DATA

The response didn’t have cacheable data.

HAS_SET_COOKIE

The set-cookie header prevented caching this request. You can look into removeCookies if you want to remove some cookies from responses.

JSON_PARSE_ERROR

An error while parsing the JSON request/response prevented caching this request.

INTERNAL_ERROR

An internal error prevented caching this request.

PASSTHROUGH ONLY

The enabled passThroughOnly mode prevented caching.

LOGGING_ENDPOINT

Requests logged via Logging API cannot be cached.


Non-Cacheable Requests

The non-cacheable requests, including GraphQL errors, mutations, and non-GraphQL requests can never be cached by Stellate.

GraphQL Errors

GraphQL requests that result in errors are non-cacheable. This ensures that erroneous responses are not stored and served to users.

An image displaying a list of requests with cache status of "pass" due to a GraphQL errors

GraphQL Mutations

Mutations in GraphQL can't be cached because they represent write operations. As a result, mutation requests are sent directly to the origin server and receive a PASS status.

An image displaying a list of mutations with cache status of "pass"

Non-GraphQL requests

Non-GraphQL requests cannot be cached due to their incompatibility with the GraphQL caching system.

An image displaying a list of requests with cache status of "pass" due to a Non-GraphQL request