Topics

CDN

If you have faced a need to use CDN to speedup your website, add following configuration values to config.php file.

'urlOverrides' => array(
   'Plugin/' => "//cdn.example.com/Plugin/",
   'Theme/' => "//cdn.example.com/Theme/",
   'Ip/' => "//cnd.example.com/Ip/",
   'file/' => "//cdn.example.com/file/" /*available only in 4.2 and later*/
),

This will force Construct to use cdn.example.com to load all theme, plugin and core resources. Construct doesn't cover the hosting of your files. Use any CDN provider you like to serve your files.

Construct uses FontAwesome. And it loads from different domain. Browsers restrict that unless you set ONE of the following configuration options:

.htaccess file on the root of your website

<FilesMatch ".(svg|eot|ttf|otf|woff)">
    Header set Access-Control-Allow-Origin "*"
</FilesMatch>

Apache configuration 

<FilesMatch ".(eot|ttf|otf|woff)">
	Header set Access-Control-Allow-Origin "*"
</FilesMatch>

Nginx configuration 

if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$){
	add_header Access-Control-Allow-Origin *;
}
comments powered by Disqus