Before you take any steps please back up your files and database.
This tutorial helps you to integrate CDN into your CakePHP CDN installation. You could use either a Pull or Push Zone but in most cases is a Pull Zone sufficient. The following example will work for CakePHP version 2.4 or higher. For more details about the global configuration variables visit http://book.cakephp.org/3.0/en/development/configuration.html
1. Create a pull zone before you start the CakePHP CDN integration.
2. Define the base URL variables in your ./Config/bootstrap.php config file.
... Configure::write('App.imageBaseUrl', 'http://cdn.example.com/img/'); Configure::write('App.cssBaseUrl', 'http://cdn.example.com/css/');
3. Use the HTML helper to include your assets in your views or template.
<?php echo $this->Html->css('your-css'); ?>
%lt;link rel="stylesheet" type="text/css" href="http://cdn.example.com/css/your-css.css" />
<?php echo $this->Html->image('your-logo.png', array('alt' => 'Your Logo')); ?>
<img src="http://cdn.example.com/img/your-logo.png" alt="Your Logo" />
<?php echo $this->Html->script('your-js'); ?>
Integration has been completed! We highly recommend you to check the HTML code of your webpage to ensure that URLs have been rewritten properly from your original ones to CNAME from the control panel.
To do that press F12 or open Developers Tools in your browser, choose the Network tab and refresh the page. All static files should have your CNAME in URLs.