Cielito Lindo Productions

Discovering the beauty of God's creation | And it was very good

Use Koken with a Content Delivery Network (CDN) - Part2

If you like to try Koken with a CDN but are looking for a free service (*) you might run across 2 companies: CLOUDFLARE and incapsula (although incapsula doesn't support SSL in the free version).

In order to include CLOUDFLARE CDN into your Koken page the following steps are required:

  • Deactivate any CDN plugin inside your Koken-installation if you have it activated
  • Sign up on the cloudflare page
  • Add the url of your webpage on the dashboard and wait until cloudflare analyzes your page
  • On the next page make sure that everything except your koken page is marked to bypass the cache (only yoursite.de and www should be cached via cloudflare, your mail traffic (imap, pop, pop3, smtp) should not be cached)
  • Select a plan: CLOUDFLARE offers a free plan eg. for private blogs
  • Once you click on the next page button you'll be asked to log-in to your webspace-provider and change your current namespace server to the one of cloudflare. Once you do so cloudflare will apply the settings. (Please make sure to change the namespace server only for the domain of your koken-installation and not also for other ones you own.)
  • Next you need to set up a page rule. Add as URL eg. yoursite.com/* and as property "Cache Level: Cache Everything". After that all requests that users make on your page will be routed through the namespace server of cloudflare. Webspace (per default only images, no html code) traffic will be cached, e-mail and other traffic will be sent directly to your "own" webspace.
  • It might be necessary to tell cloudflare to not cache the admin-area of koken so that it works properly (otherwise eg. you might not see update notes for new releases). To do so add a page rule in the dashboard: Add eg. http://www.yoursite.com/admin as url and set the cache level to Bypass.
  • After some days go to your dashboard and check that on the Analytics tabs the "Cached Requests" are not 0 as otherwise your Cache is not set up properly. Certain pages that offer website speed measurements also mention if code is served through a CDN, so that would be another option to verify your setup.
  • Please be aware that if you are running a statistics tool within your domain that then inside the statistics tool the locations/countries of the cloudflare servers instead of those of your page visitors will show up. This is due to the fact that CLOUDFLARE is a reverse proxy. There are several ways to fix this: Please check eg. this CLOUDFLARE support site, a second support site or the Piwik help.

If you use a shared certificate on your koken-installation it will be passed automatically to CLOUDFLARE.

That's it - you should be done now. ;-)

Please also check my other blog post about CDN here
(*) There are also plenty of other companies that offer CDN services but with a cost like SecureCDN (formerly MaxCDN), Coral, HostEurope, Cloudtront.