Developer Specification · v2.7

API & Integration Guide

Reference documentation for fetching, verifying, and caching media assets through the edge node tier.

Edge Endpoints

The edge node exposes two primary HTTP primitives for media delivery, plus a JSON index of mirrored objects.

GET /assets/<path>
Cached

Retrieves the full asset payload. If present in local memory or NVMe cache tier, the edge node responds with a cache hit header. Requests for objects that were never mirrored return 404.

Response Codes: 200 OK, 206 Partial Content (Range requests supported), 304 Not Modified, 404 Not Found.
HEAD /assets/<path>
Header Only

Retrieves only response headers without the payload body. Used by asset pipeline verifiers to check asset availability, content length, ETag hash, and cache expiration state without consuming bandwidth.

Response Codes: 200 OK, 304 Not Modified, 404 Not Found.
GET /api/v1/assets/index.json
JSON Metadata

Returns the manifest of mirrored objects, including storage tier, content type, exact byte count, and replication timestamps.

Cache Control & Revalidation Policy

The edge node implements RFC 9111 HTTP Caching standards with internal automated replication:

1. TTL (Time To Live)

Standard media objects are cached according to the Cache-Control: max-age=<seconds> directive. Default TTL for versioned immutable assets is 2,592,000 seconds (30 days); dynamic graphics default to 86,400 seconds (24 hours).

2. ETag Revalidation

Clients sending If-None-Match: <etag> or If-Modified-Since receive an instant 304 Not Modified from edge RAM without reading disk or origin storage if the object fingerprint matches.

3. Stale-While-Revalidate

When stale-while-revalidate=<seconds> is present, this edge node immediately serves the expired cache copy to the client while firing an asynchronous background pull to update the cache from the origin storage without blocking requests.

Edge Diagnostic Headers: Every response includes X-Cache-Status: HIT | MISS | REVALIDATED, X-Edge-Node: media-cache-sjc, and X-Cache-Tier: RAM_LRU | NVME_WARM.

Sample Request & Response

Example request to query asset metadata using curl:

BASH · CURL REQUEST CLI
curl -s -H "Accept: application/json" \
  https://media-assets-cache.joyzyl.com/api/v1/assets/index.json

Manifest response (truncated to one entry):

JSON · RESPONSE PAYLOAD STATUS: 200 OK
{
  "node_id": "media-cache-sjc",
  "count": 8,
  "objects": [
    {
      "asset_id": "ast_6d5a696aae",
      "path": "/assets/promo-banner-autumn.webp",
      "content_type": "image/webp",
      "content_length": 20530,
      "content_md5": "6d5a696aae90b0aaeea46063e51c9ae5",
      "cache_tier": "ram_lru",
      "cache_control": "public, max-age=2592000",
      "last_modified": "2026-11-23T18:45:00Z"
    }
  ]
}

Rate Limiting & Concurrency Policies

Usage Limits

To keep the mirror responsive for everyone, requests are limited per client IP:

  • Standard clients: 600 requests per minute per IP address.
  • Bulk mirroring: contact the operator for a higher quota before running a large batch.

Exceeding limits returns HTTP status 429 Too Many Requests with standard rate headers: X-RateLimit-Limit, X-RateLimit-Remaining, and Retry-After.