Integrate CakePHP with Medianova CDN
Learn how to integrate CakePHP with Medianova CDN to deliver static assets such as images, CSS, and JavaScript files faster and improve website performance.
Prerequisites
Integration Steps
1
2
<?php
Configure::write('App.imageBaseUrl', 'https://<CDN_ZONE_URL>/img/');
Configure::write('App.cssBaseUrl', 'https://<CDN_ZONE_URL>/css/');
Configure::write('App.jsBaseUrl', 'https://<CDN_ZONE_URL>/js/');3
<?php echo $this->Html->image('medianova-logo.png', ['alt' => 'Medianova Logo']); ?><img src="https://example.mncdn.com/img/medianova-logo.png" alt="Medianova Logo" />4
<?php echo $this->Html->css('style.css'); ?><link rel="stylesheet" type="text/css" href="https://example.mncdn.com/css/style.css" />5
<?php echo $this->Html->script('script.js'); ?><script type="text/javascript" src="https://example.mncdn.com/js/script.js"></script>6
Troubleshooting
Problem
Cause
Solution
Last updated
Was this helpful?