I recent used gtmetrix to speed review my site and one of the main issues was the lack of CDN use. A CDN is a Content Delivery Network, you host things like javascript, css, images on a network that spans the glob, then these assets get loaded quicker.
I got a bit confused. I thought I need to use something like the s3fs module, which is the amazon s3 file storage system module. I thought I need to upload these files to the network and then use the CDN module to change the paths. Turns out I was making it to complicated. The CDN module is all you need. It changes the urls from you server to urls that point at amazon cloud front. When these urls are hit, it prompts cloud front to host the files. This is a Pull-Origin CDN.
The other thing I did was to tweak the settings.php file so I could easiliy use aggregation, cdn network etc or not, for different environments, makes local dev easier.
if ($env == 'live') {
$config['cdn.settings']['status'] = true;
}
else {
$config['cdn.settings']['status'] = false;
}
Once this was setup it worked perfect.
Add new comment