Deliver GitHub files at
edge speed
Eclipse CDN turns any GitHub repository into an instant, globally distributed asset network. No config. No cost.
Everything you need,
nothing you don't.
Eclipse CDN is purpose-built for GitHub assets — fast, simple, and entirely free.
GitHub-native
Point it at any public GitHub repo. Use a tag, commit hash, branch, or @latest for auto-resolution. It just works.
Global Edge Network
Served via Cloudflare Workers across 300+ data centers. Files are cached at the edge closest to your users automatically.
CORS Everywhere
Every response includes permissive CORS headers, so you can load assets directly from the browser without any server-side proxying.
Smart MIME Types
Automatic content-type detection for JS, CSS, fonts, images, WASM, JSON, and more — no manual configuration needed.
Immutable Caching
Versioned URLs are cached with immutable directives. Branches get smart stale-while-revalidate headers.
Zero Config Deploy
One wrangler deploy and you're live. No origin servers, no storage buckets, no infrastructure headaches.
How to use Eclipse CDN
Everything you need to get assets loading at global edge speed.
URL Format
All Eclipse CDN URLs follow a consistent pattern. Currently, only GitHub repositories are supported.
https://eclipsecdnworker.eclipseservice.workers.dev/gh/:user/:repo@:version/:file
| Segment | Description | Example |
|---|---|---|
| /gh/ | GitHub provider prefix (required) | /gh/ |
| :user | GitHub username or org name | jquery |
| :repo | Repository name | jquery |
| @:version | Tag, branch, commit SHA, or @latest | @3.7.1 |
| :file | File path within the repo | dist/jquery.min.js |
Note: Only public GitHub repositories are supported. Private repositories require a personal access token configured in the worker environment.
Versioning
Eclipse CDN supports multiple ways to reference a specific version of a file from GitHub.
/gh/user/repo@3.7.1/dist/file.min.js
/gh/user/repo@latest/dist/file.min.js
/gh/user/repo@main/src/index.js
/gh/user/repo@a1b2c3d/dist/file.js
Production tip: Always pin to a specific tag or commit SHA in production. Using @main or @latest means the cached file can change on the next cache bust. Tags and commit SHAs are served with immutable cache headers.
Examples
Drop-in examples for common use cases — load anything from any public GitHub repo.
<script src="https://eclipsecdnworker.eclipseservice.workers.dev/gh/jquery/jquery@3.7.1/dist/jquery.min.js"></script>
<link rel="stylesheet" href="https://eclipsecdnworker.eclipseservice.workers.dev/gh/twbs/bootstrap@5.3.3/dist/css/bootstrap.min.css">
const mod = await import(
"https://eclipsecdnworker.eclipseservice.workers.dev/gh/user/repo@1.0.0/src/module.js"
);
@import url("https://eclipsecdnworker.eclipseservice.workers.dev/gh/user/repo@main/styles/theme.css");
const res = await fetch(
"https://eclipsecdnworker.eclipseservice.workers.dev/gh/user/repo@latest/data/config.json"
);
const config = await res.json();
Response Headers
Every Eclipse CDN response includes these headers for debugging and integration.
- X-Eclipse-CDNAlways
1. Confirms the response passed through Eclipse CDN. - X-Eclipse-SourceThe resolved path in
gh/user/repo@ref/fileformat. - X-Eclipse-UpstreamThe exact raw.githubusercontent.com URL fetched upstream.
- Cache-Control
immutablefor tags/commits; stale-while-revalidate for branches. - Content-TypeAutomatically detected from file extension.
- Access-Control-Allow-Origin
*— CORS open for all origins. - Timing-Allow-Origin
*— allows Resource Timing API access.
Caching Strategy
Eclipse CDN uses Cloudflare's edge cache and an optional KV namespace to maximize performance and minimize GitHub API calls.
| Ref Type | Cache-Control | TTL |
|---|---|---|
| Tag / Release (e.g. @1.0.0) | public, immutable | 24 hours (edge) |
| Commit SHA | public, immutable | 24 hours (edge) |
| @latest | public, stale-while-revalidate | 1 hour + 24h stale |
| Branch (main, master, etc.) | public, stale-while-revalidate | 1 hour + 24h stale |
KV caching stores resolved @latest tag lookups for 1 hour to avoid hitting the GitHub API on every request. Configure the ECLIPSE_CACHE KV binding in your wrangler.toml to enable this.
Error Responses
When something goes wrong, Eclipse CDN returns a JSON error body with a descriptive message.
{
"error": "File not found on GitHub",
"status": 404,
"details": {
"user": "jquery",
"repo": "jquery",
"ref": "9.9.9",
"file": "dist/jquery.min.js"
}
}
| Status | Meaning |
|---|---|
| 400 | Invalid URL format — check the path structure |
| 403 | GitHub rate limit hit or repo is private |
| 404 | File, repo, or ref does not exist on GitHub |
| 405 | Only GET and HEAD are supported |
Self-Hosting
Eclipse CDN is open source and designed to be trivially deployable on your own Cloudflare account in under five minutes.
git clone https://github.com/xXmizzeryXx/eclipse-cdn
cd eclipse-cdn
npm install -g wrangler
wrangler kv:namespace create ECLIPSE_CACHE
# Copy the id into wrangler.toml
wrangler deploy
Optional: Add a GITHUB_TOKEN secret via wrangler secret put GITHUB_TOKEN to increase your GitHub API rate limit from 60 to 5,000 requests/hour.
Start delivering at the edge
Join the Eclipse community or deploy your own instance in minutes — completely free.