Getting Started

Mylink Speestar Documentation

Everything you need to integrate, configure, and get the best out of your CDN.

What is Mylink Speestar?

Mylink Speestar is a reverse-proxy CDN that caches static assets from your origin server and serves them at edge speed. Instead of your visitors hitting your origin for every image, stylesheet, or script — those files are fetched once, cached, and delivered directly by Mylink Speestar on all subsequent requests.

It is designed to be simple to set up: no CLI tools, no complicated config files. You create a site, get your API token, point your assets at the CDN URL, and that is it.

Key Features

  • Reverse-proxy caching — assets are fetched from your origin and cached transparently.
  • Per-site API tokens — granular, revocable tokens so each site is independently controlled.
  • Cache purge API — instantly invalidate a single path or the entire site cache via HTTP.
  • Real-time analytics — hit/miss ratios, bytes served, and per-request logs in your dashboard.
  • Custom CDN domain — serve assets from your own subdomain (e.g. cdn.yoursite.com).
  • Referer locking — restrict which origins may request assets through your CDN site.

How to use these docs

Use the sidebar on the left to navigate sections, or the prev/next buttons at the bottom of each page. If you are new, follow the Quick Start guide. If you need to integrate programmatically, see Integration Overview or jump straight to the API Reference.

New to CDNs? Start with How the CDN Works to understand the fundamentals before diving in.
Getting Started

Quick Start

Go from zero to serving cached assets in under five minutes.

Step 1 — Create an account

Register at https://mylink.ng/auth/register. After verifying your email you will land on the dashboard.

Step 2 — Add a site

Go to My Sites → Add Site and fill in:

FieldDescription
NameA human-readable label (e.g. "My Blog")
Origin URLYour server's base URL — e.g. https://yoursite.com
SlugShort identifier used in CDN URLs — e.g. myblog
RefererOptional. Lock requests to a specific origin domain.

Step 3 — Copy your API token

Open the site you just created, reveal the API Token, and copy it. You will use this token to authenticate purge requests and integration scripts. Keep it secret — treat it like a password.

Step 4 — Update your asset URLs

Replace your origin asset URLs with the CDN URL shown on the site detail page:

Pattern
https://speed.mylink.ng/{slug}/{path/to/asset.ext}

Example: if your origin serves https://yoursite.com/assets/app.css:

CDN URL
https://speed.mylink.ng/myblog/assets/app.css

Step 5 — Verify

Open your site detail page — you will see requests appear in the Recent Requests log within seconds. First hit = MISS (fetched from origin), all after = HIT (from cache).

The first request for any asset will always be a MISS. All following requests are HITs until the cache is purged or the site is reset.
Getting Started

Authentication

All API and integration requests are authenticated via a per-site API token. Tokens are scoped to a single site and can be regenerated at any time.

Getting your token

Go to Dashboard → My Sites → [your site] → API Token. Click the eye icon to reveal the full token, then copy it. Every site has its own unique token.

Where the token is used

  • Purge API — pass as ?token= query parameter to authenticate cache purge requests.
  • Stats API — same, to read site statistics programmatically.
  • Integration scripts — store in your environment (e.g. .env file) and reference it in deploy scripts or CMS plugins.

Using the token in API calls

HTTP
GET https://mylink.ng/api/purge?token=YOUR_TOKEN&slug=YOUR_SLUG

Storing your token safely

Never hard-code your token in public files or commit it to a repository. Store it as an environment variable on your server:

bash — .env
CDN_TOKEN=your_token_here
CDN_SLUG=your_slug_here
CDN_BASE=https://speed.mylink.ng/your_slug

Then reference it in your code:

PHP
$token = getenv('CDN_TOKEN');
$slug  = getenv('CDN_SLUG');
Node.js
const token = process.env.CDN_TOKEN;
const slug  = process.env.CDN_SLUG;
Keep your token secret. Anyone with the token can purge your cache and read your stats. If a token is exposed, regenerate it immediately from the site detail page — old tokens are invalidated instantly.
Core Concepts

How the CDN Works

Understanding the request lifecycle helps you debug cache misses, configure origin headers, and get the best performance.

Request lifecycle

  1. A visitor's browser requests https://speed.mylink.ng/{slug}/{path}.
  2. The CDN checks its cache for that slug + path combination.
  3. HIT — the cached bytes are returned immediately. Your origin is not contacted.
  4. MISS — the CDN fetches the asset from your origin (origin_url + path), stores the response in cache, then returns it to the visitor.
  5. Cache entries persist until explicitly purged.

What gets cached

Any path your origin returns a 200 OK for will be cached. Non-200 responses (redirects, 404s, 500s) are not cached — the CDN returns the status transparently and marks the request as a miss.

Cache key

The cache key is the combination of site slug + request path (query strings are stripped). Two requests for the same path always hit the same cache entry regardless of query string.

If your assets have cache-busted filenames (e.g. app.abc123.css), every new build automatically creates a new cache entry. No purge needed.

Byte accounting

The Bytes Served stat counts bytes delivered to visitors — from both hits and misses. This is the traffic you are saving your origin from serving repeatedly.

Core Concepts

Sites & Slugs

A site is the unit of configuration. Each site maps a slug to an origin URL and carries its own API token, stats, and cache.

Slug rules

Slugs must be lowercase and may only contain letters, numbers, hyphens, underscores, and dots:

ValidInvalid
myblogMy Blog (spaces not allowed)
shop-v2shop/v2 (slash not allowed)
api.prodAPI_PROD (uppercase not allowed)

Origin URL

The origin is your server — the CDN proxies requests there on cache misses. It must be a reachable HTTP/HTTPS URL without a trailing slash.

Referer locking

If you set a Referer, the CDN only serves requests whose Referer header matches. Requests from other origins receive 403 Denied. Leave blank to allow all.

Enabling / Disabling

Disabled sites return 503 for all requests. Cached assets are preserved — re-enabling restores service immediately.

Core Concepts

Caching Behaviour

Cache storage

Cached assets are stored on the CDN server's filesystem (local driver) or in an S3-compatible object store, depending on your platform's storage configuration.

Cache headers

The CDN does not honour Cache-Control or Expires headers from your origin. All 200 responses are cached indefinitely until purged. This means you should either:

  • Use cache-busted filenames (recommended) — e.g. app.v2.css instead of app.css.
  • Call the purge API after deployments to invalidate stale files.

Cache hit ratio

RatioMeaning
< 40%Cache warming, or origin returning non-cacheable responses
40–70%Good — improving with traffic
> 70%Excellent — origin load is well reduced
Integration Guides

Integration Overview

This section explains everything a developer needs to connect their site or application to Mylink Speestar.

What you need before integrating

To integrate with Mylink Speestar you need three things from your dashboard:

ItemWhere to find itUsed for
CDN Base URLSite Detail → CDN URLsPrefix all your asset URLs
Site SlugSite Detail → shown in code snippetsIdentify your site in API calls
API TokenSite Detail → API Token (reveal with eye icon)Authenticate purge / stats calls

The integration pattern

Every integration follows the same two-step pattern regardless of your tech stack:

  1. Rewrite asset URLs — change where your HTML, CSS, or framework loads assets from. Instead of yoursite.com/assets/app.css use https://speed.mylink.ng/{slug}/assets/app.css.
  2. Automate cache purging — after any deployment or content update, call the purge API with your token so the CDN does not serve stale files.

Token in integrations

Your API token is required for any server-side call (purge, stats). Store it as an environment variable — never in source control or client-side code.

Purge call — generic HTTP
GET https://mylink.ng/api/purge?token=YOUR_TOKEN&slug=YOUR_SLUG&path=/assets/app.css

See the specific guides for your stack:

Integration Guides

HTML / Static Sites

The simplest integration — update your asset src and href attributes, and optionally call the purge API on deploy.

Step 1 — Rewrite asset URLs

Before
<link rel="stylesheet" href="https://yoursite.com/assets/app.css">
<script src="https://yoursite.com/assets/app.js"></script>
<img src="https://yoursite.com/images/hero.jpg">
After
<link rel="stylesheet" href="https://speed.mylink.ng/YOUR_SLUG/assets/app.css">
<script src="https://speed.mylink.ng/YOUR_SLUG/assets/app.js"></script>
<img src="https://speed.mylink.ng/YOUR_SLUG/images/hero.jpg">
Define a base URL constant at the top of your template so you only update one line when the CDN URL changes.

Step 2 — Purge on deploy

Add this to your deploy script (replace values with your actual token and slug from the dashboard):

bash
curl -s "https://mylink.ng/api/purge?token=$CDN_TOKEN&slug=$CDN_SLUG"
echo "CDN cache purged"
Integration Guides

WordPress

Two options: use the official plugin (recommended) or add a manual snippet to your theme.

Option A — Official Plugin (Recommended)

The easiest way to connect WordPress to Mylink Speestar is with the official plugin. It handles URL rewriting, token authentication, and automatic cache purging on post publish/update — no code required.

Speestar

Official WordPress plugin — URL rewriting + auto cache purge on publish.

Download

After installing and activating the plugin, go to Settings → Speestar and enter:

  • CDN Base URL — from your site detail page
  • Site Slug — your site's slug
  • API Token — from your site detail page (keep this secret)
The plugin automatically purges the CDN whenever you publish or update a post, so you never have to call the API manually.

Option B — Manual snippet

If you prefer not to install a plugin, add the following to your theme's functions.php. You will also need to manage purging manually or via a deploy script.

1. Rewrite asset URLs

Add this to functions.php — replace YOUR_SLUG with your actual site slug from the dashboard:

PHP — functions.php
define('MYCDN_BASE', 'https://speed.mylink.ng/YOUR_SLUG');
define('MYCDN_TOKEN', getenv('CDN_TOKEN')); // set CDN_TOKEN in your server env

add_filter('script_loader_src', 'mycdn_rewrite', 10, 2);
add_filter('style_loader_src',  'mycdn_rewrite', 10, 2);

function mycdn_rewrite($src) {
    if (is_admin()) return $src;
    return str_replace(home_url(), MYCDN_BASE, $src);
}

// Also rewrite media / uploaded images
add_filter('wp_get_attachment_url', 'mycdn_rewrite');
add_filter('wp_calculate_image_srcset', function($sources) {
    foreach ($sources as &$s) {
        $s['url'] = mycdn_rewrite($s['url']);
    }
    return $sources;
});

2. Auto-purge on publish

Add this to automatically purge the CDN when a post is published or updated:

PHP — functions.php
add_action('save_post', 'mycdn_purge_on_save', 10, 2);

function mycdn_purge_on_save($post_id, $post) {
    if (wp_is_post_revision($post_id) || $post->post_status !== 'publish') return;
    $token = MYCDN_TOKEN;
    $slug  = 'YOUR_SLUG';
    wp_remote_get(
        "https://mylink.ng/api/purge?token={$token}&slug={$slug}",
        ['blocking' => false, 'timeout' => 3]
    );
}

3. Set your token in the server environment

Add to your wp-config.php or server .env:

wp-config.php
putenv('CDN_TOKEN=YOUR_API_TOKEN_FROM_DASHBOARD');
Do not rewrite admin, login, or REST API URLs. The is_admin() check above handles the admin panel — also ensure caching plugins exclude /wp-json/ and /wp-admin/ from their own rewrites.
Integration Guides

Laravel

Configure Laravel's asset URL helper to point to the CDN and automate cache purging on deploy.

Step 1 — Set credentials in .env

Add your CDN details to your Laravel .env file. Get these from your site detail page in the dashboard:

.env
ASSET_URL=https://speed.mylink.ng/YOUR_SLUG
CDN_TOKEN=your_api_token_from_dashboard
CDN_SLUG=your_slug

Setting ASSET_URL tells Laravel's asset() helper to automatically prefix all asset URLs with your CDN base. No code changes needed in blade templates.

Step 2 — (Optional) Vite / Mix

If you use Vite, set the base in vite.config.js:

vite.config.js
export default defineConfig({
  base: 'https://speed.mylink.ng/YOUR_SLUG/',
  // ...
});

Step 3 — Purge on deploy

Add a purge call to your deploy script. The token and slug come from your .env so they are never hard-coded:

bash — deploy.sh
php artisan migrate --force
php artisan config:cache
php artisan view:cache

# Purge CDN cache after deploy
curl -s "https://mylink.ng/api/purge?token=$CDN_TOKEN&slug=$CDN_SLUG"
echo "CDN cache purged"

Step 4 — (Optional) Purge from PHP

You can also purge from within Laravel — for example, in a model observer or after content updates:

PHP
use Illuminate\Support\Facades\Http;

Http::get('https://mylink.ng/api/purge', [
    'token' => env('CDN_TOKEN'),
    'slug'  => env('CDN_SLUG'),
    'path'  => '/assets/app.css', // omit to purge everything
]);
API Reference

API Overview

The Mylink Speestar API is a lightweight HTTP API. All endpoints accept GET requests and return JSON.

Base URL

Base
https://mylink.ng/api

Authentication

Pass your site's token as a query parameter on every request. See Authentication for how to get and store your token.

Response format

Success
{ "ok": true, "message": "Cache purged.", "purged": 14 }
Error
{ "ok": false, "error": "Invalid token." }

Endpoints

EndpointMethodDescription
/api/purgeGETPurge cached assets — requires token + slug
/api/statsGETFetch site statistics — requires token + slug
API Reference

Purge Cache

Invalidates cached assets for a site — either a single path or the entire cache. Requires your API token.

Endpoint

HTTPGET
https://mylink.ng/api/purge

Parameters

ParameterRequiredDescription
tokenYesYour site API token — find it on the site detail page
slugYesYour site slug
pathNoSpecific path to purge (e.g. /assets/app.css). Omit to purge the entire site.

Examples

Purge a single file

curl
curl "https://mylink.ng/api/purge?token=YOUR_TOKEN&slug=YOUR_SLUG&path=/assets/app.css"

Purge entire site

curl
curl "https://mylink.ng/api/purge?token=YOUR_TOKEN&slug=YOUR_SLUG"

JavaScript (fetch)

JavaScript
// Store your token server-side — never expose it in client JS
const res  = await fetch(
    'https://mylink.ng/api/purge?token=TOKEN&slug=SLUG'
);
const data = await res.json();
console.log(data.ok, data.message, 'purged:', data.purged);

PHP (curl)

PHP
$token = getenv('CDN_TOKEN');
$slug  = getenv('CDN_SLUG');
$url   = "https://mylink.ng/api/purge?token={$token}&slug={$slug}";
$json  = file_get_contents($url);
$data  = json_decode($json, true);
// $data['ok'] === true on success

Response

JSON
{ "ok": true, "message": "Cache purged.", "purged": 14 }

purged is the number of cached entries deleted.

API Reference

Statistics

Retrieve request statistics for a site programmatically. Requires your API token.

Endpoint

HTTPGET
https://mylink.ng/api/stats

Parameters

ParameterRequiredDescription
tokenYesYour site API token
slugYesYour site slug

Example

curl
curl "https://mylink.ng/api/stats?token=YOUR_TOKEN&slug=YOUR_SLUG"

Response

JSON
{
  "ok": true,
  "stats": {
    "total":   1482,
    "hits":    1241,
    "misses":   201,
    "denied":    30,
    "errors":    10,
    "bytes":  94371840
  },
  "hit_ratio": 83
}
Account

Plans & Limits

Each plan defines the resources available to your account. View and upgrade from Dashboard → Billing & Plans.

Plan limits

ResourceDescription
SitesMaximum number of CDN sites you can create
Requests / monthTotal CDN requests across all your sites
Bandwidth / monthTotal bytes served from cache

Exact limits for each plan are shown on the Pricing page.

Overages

When you exceed a plan limit, CDN requests may be throttled until the next billing cycle or until you upgrade. You will receive an email before limits are reached.

Upgrading

Go to Dashboard → Billing & Plans, select a new plan, and complete payment. Limits are raised immediately after confirmation.

Account

Billing

Payments

Payments are processed via Paystack or Kora. We do not store card details on our servers.

Billing cycle

Plans are billed monthly from the date of subscription. Your plan expiry date is shown in the dashboard sidebar.

Cancellation

You can cancel or downgrade at any time. Your current plan remains active until the expiry date — no prorated refunds.

Receipts

Payment receipts are listed under Dashboard → Billing & Plans → Payment History. Contact support for a formal invoice.

Troubleshooting

FAQ

Why is my hit ratio still 0%?

The first request for every asset is always a miss. Ratios improve as traffic increases. If it stays at 0% after significant traffic, check that your assets return 200 OK — non-200 responses are never cached.

Can I use my own domain for CDN URLs?

Yes — if your administrator has configured a custom CDN domain in Settings → General, all CDN URLs will use that domain instead of the platform URL.

My asset updated on origin but the CDN still serves the old version.

Call the Purge API for that specific path, or use cache-busted filenames so the old path is never requested again.

I get a 403 Denied response.

Your site has Referer locking enabled and the request's Referer header does not match. See Error Reference.

Do I need the token to serve assets?

No. The token is only required for the Purge and Stats API calls. Asset serving (the CDN URLs visitors use) is public and token-free.

Can I use Mylink Speestar for video streaming?

The CDN can cache and serve any file type, including video. Large video files may exceed storage limits on your plan — contact support for high-volume media needs.

Troubleshooting

Error Reference

StatusTypeMeaning & Fix
403DENIEDBlocked by Referer locking. Remove the restriction on the site or ensure requests include the correct Referer header.
404NOT FOUNDSlug does not exist or site is disabled. Verify the slug in your dashboard.
500ERRORCDN failed to fetch from your origin, or an internal error occurred. Check your origin URL is correct and reachable.
503OFFLINESite has been disabled. Re-enable it from the dashboard.
API {"ok":false}Invalid tokentoken is missing, wrong, or belongs to a different slug. Verify token and slug match the same site.
API {"ok":false}Site not foundslug does not match any site. Check for typos.

Contacting support

If you encounter an error not listed here, visit the Contact page with the request URL, the response received, and your site slug.