{
  "name": "Pornhub R2 Worker",
  "version": "3.0.0",
  "description": "Secure file storage with edge caching (optimized)",
  "endpoints": {
    "POST /upload": "Upload file (with JWT verification support)",
    "GET /{key}": "Download file (with signature verification & edge cache)",
    "GET /{key}?segments=N": "Generate video preview M3U8 (N segments)",
    "GET /files": "List files with pagination",
    "DELETE /{key}": "Delete file and invalidate cache",
    "GET /metadata/{key}": "Get file metadata",
    "POST /generate-signed-url": "Generate signed URL for secure access",
    "GET /cache/stats": "Get edge cache statistics",
    "GET /health": "Health check"
  },
  "optimizations": {
    "singleton": "R2FileManager reused across requests",
    "rangeCaching": "Metadata cache + full-file cache slicing for Range",
    "directorySignature": "One HMAC per M3U8 instead of per-segment",
    "conditionalRequests": "ETag/If-None-Match 304 support"
  }
}