Integrate Phalcon with Medianova CDN
Learn how to integrate Phalcon, a high-performance PHP framework, with Medianova CDN to serve static assets efficiently and enhance website performance.
Prerequisites
Integration Methods
1
2
Use Asset Collections with Conditional CDN Prefix
<?php
$css = $this->assets->collection('header');
$scripts = $this->assets->collection('footer');
if ($config->environment == 'development') {
$css->setPrefix('/');
$scripts->setPrefix('/');
} else {
$cdnURL = 'https://<CDN_ZONE_URL>/';
$css->setPrefix($cdnURL);
$scripts->setPrefix($cdnURL);
}
$css->addCss('css/bootstrap.min.css')
->addCss('css/custom.css');
$scripts->addJs('js/jquery.js')
->addJs('js/bootstrap.min.js');
3
Troubleshooting
Problem
Cause
Solution
Last updated
Was this helpful?