CDN plugin for Koken
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

CDN plugin for Koken

This Koken plugin allows to use an alternate domain name for different asset types (images, scripts, stylesheets) and therefore route them through a CDN instead of serving them directly.

CDN requirement

The source for your CDN edges remains your website. Create an endpoint pointing to

Due to the way i.php is written, the CDN edges need to able to rewrite the host header and call your website with and not

If your CDN can't rewrite headers or force TTL's, your site needs to provide correct Cache-Control headers. Koken's default is to not cache scripts and stylesheets. An Apache and Nginx sample can be found inside the server folder.


Once installed, you need to define the alternate domain name to use. As long as the domain is not defined, the plugin will skip rewriting the URL's. By default all assets types are routed using the alternate domain name. You can disable depending on the type.


For CSS, Javascripts, Stylesheets and Icons, only relative links are rewritten to make use of the CDN. If you use the HTML Injector plugin, make sure to use relative links for your icons.

<link rel="icon" type="image/png" href="/favicon-160x160.png" sizes="160x160">