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
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
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
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
There are various reasons why requests might bypass cache and be by forwarded to the origin server. The passthrough can occur due various factors ranging from specifics of the request itself to explicit Stellate configuration that prevents caching.
Learn more about preventing caching for specific types in the Cache Rules documentation.
No matching rules found
There are no rules in the current config targeting this request.
The cache rule(s) prevented caching
The following cache rule(s) prevented caching this request.
Matches Non-Cacheable List
A non-cacheable type or field in the request prevented caching this request.
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 60KB 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.
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.
Non-GraphQL requests
Non-GraphQL requests cannot be cached due to their incompatibility with the GraphQL caching system.