CDN Manager Docs

Documentation
Created 6-24-2013

Installation


IMPORTANT: Before installing, enabling, disabling or un-installing CDN Manager, disable "overrides cache" in the concrete5 dashboard located here.

Dashboard > System & Settings > Optimization > Cache & Speed settings

Once CDN Manager is installed, enabled, disabled or un-installed, overrides cache can be re-enabled.

Manual Installation

1) Download CDN Manager and unzip it on your desktop.

Using FTP access, upload the package to your /packages directory.

Marketplace Installation

1) After you connect your site to the marketplace, a project page is automatically created for your domain.

Visit the project page on concrete5.org and attach CDN Manager to the project.

My Account > Projects



2) Visit the install page located in your concrete5 dashboard and click install next to CDN Manager.


After installation is complete, go back to your concrete5 dashboard and notice the two new links that are available.


CDN Settings


The CDN settings page is where you set your CDN URL.

To enable the CDN, input your temp or custom CDN URL (including http://), set the status to "on" then click save.

Upon clicking save, a built in function checks to make sure that the CDN is resolving correctly. If the CDN is not resolving, this field won't save and will be left blank.

We will be including support for additional CDN's in future versions of CDN Manager. This page may include additional settings to support these CDN's.

Max CDN API


The Max CDN API provides access to your MAX CDN account right from your concrete5 dashboard.

There is no need to visit the maxcdn.com portal everytime you need to perform simple actions such as clearing the CDN cache.


To enable the Max CDN API, first log in your max CDN account and configure your API here.

1) Obtain your "Alias" under "Your API Info"

2) Click Create Application

3) Input a name and description for your application. (Can be anything you like)

NOTE: Application URL and Callback URL are not used or required at this time.

4) Click "Register Application"

5) After clicking "register application", obtain your "Consumer Key" and "Consumer Secret"


Now visit the "Max CDN API" page located in your concrete5 dashboard.

Input your "Alias", "Consumer Key" and "Consumer secret" then click save.


Custom Templates


CDN Manager for concrete5 comes with custom templates for the default Image, Video and File Blocks to offer complete CDN integration.

These custom templates force these blocks to load their contents from the CDN.

After adding one of these blocks to a page, while still in edit mode, click on the block and from the pop up select "custom template".

Select "CDN" from the drop selection then click save.

Exit edit mode, publish edits.


FAQs


When the CDN is enabled, 1 line of code gets saved to this file.

/config/site.php

To manually disable the CDN, open this file and delete this one line of code.

Example

<?php define('CDN_URL', 'http://cdn.hostco.com');?>
1) Make sure that /helpers/html.php is in the root /helpers directory.

If it is not, copy it there from

/packages/cdn_manager/helpers/html.php

2) This step may not be necessary, but if your sites display is still having issues after copying the html.php file to the root /helpers directory, you may need to manually delete the cache files from

/files/cache/

CDN Manager includes custom templates for the default concrete5 Image, Video and File blocks. These custom templates force these blocks to load their contents from the CDN.

Once an Image, Video or File block is added to a page, while still in edit mode, click on the block and instead of clicking edit, click "custom template".

Select "CDN" from the drop selection, then click save.

Exit edit mode, publish edits.
If the paths to your themes JS/CSS files are dynamic, they will automatically load from the CDN when the CDN is enabled. If the paths are static, they will not.

To load your themes JS/CSS files from the CDN, either edit your static links to full paths that include the CDN URL (including http://) or change them from static to dynamic .

To change your CSS/JS links from static to dynamic change them to look like this.

<link rel="stylesheet" media="screen" type="text/css" href="<?php echo CDN_URL; ?>/static-path/style.css" />


<script type="text/javascript" src="<?php echo CDN_URL; ?>/static-path/jquery.js"></script>

Standard concrete5 dynamic paths are supported as well.