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

Readme.md

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 cdn.yoursite.com pointing to yoursite.com.

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

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.

Configuration

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.

Compatibility

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">