CDN Integration in Yii 2 App. Using CloudwaysCDN to call CSS file from CDN. Full article at: https://www.cloudways.com/blog/cdn-in-yii2/
// ...
'components' => [
// ...
'cdn' => [
'class' => '\yii2cdn\Cdn',
'baseUrl' => defined ('YII2CDN_OFFLINE')
? 'http://localhost/yii2/cdn'
: '//71265-358070-raikfcquaxqncofqfm.stackpathdns.com/cdn',
'basePath' => dirname(__DIR__, 2) . '/cdn',
'components' => [
'font-awesome' => [
'css' => [
[
// local version
'font-awesome.min.css',
// cdn version
'@cdn' => '//71265-358070-raikfcquaxqncofqfm.stackpathdns.com/cdn/font-awesome/css/font-awesome.min.css',
]
]
]
],
],
// ...
],
// ...