This article will show you the proper way of integrating your MaxCDN Pull Zone with your B2Evolution CMS.
This tutorial assumes you have already created a Pull Zone.
Implementation of CDN for b2evolution
Below are example snippets of the file you will need to edit in order to set the path variables to point to the CDN location.
We have used the placeholder domain, foo.bar.netdna-cdn.com
for this example, please make sure you replace it with either the Temp CDN URL for your Pull Zone, or with the custom URL you have pointed to your Temp URL via CNAME.
- Open
blogs/conf/_advanced.php
- Add the following code on top of the page:
$cdnurl = ‘http://foo.bar.netdna-cdn.com/’;
- So that first line of code looks like this:
<?php $cdnurl = ‘http://foo.bar.netdna-cdn.com/’;
- Find the following line:
$rsc_url = $baseurl.$rsc_subdir;
- Replace it with:
$rsc_url = $cdnurl.$rsc_subdir;
- Find the following line:
$skins_url = $baseurl.$skins_subdir;
- Replace it with:
$skins_url = $cdnurl.$skins_subdir;
- Find the following line:
$media_url = $baseurl.$media_subdir;
- Replace it with:
$media_url = $cdnurl.$media_subdir;
Testing your Integration
To ensure you implemented MaxCDN correctly, you can view the source code of any page to confirm that the CDN domain is being used for static assets instead of your origin domain. You can also use tools like pingdom, gtmetrix, webpagetest that can give you more detailed reports on your CDN implementation status.
We hope this article was helpful and as always, If you have any questions or concerns about any of the topics mentioned in this article, please feel free to reach out to support - we are available 24/7 by chat or email!