vBSEO 3.6 offers built in integration for using a CDN service, such as MaxCDN (see the 3.6 release announcement for more details on how to obtain your Free account!).
Setting up the service requires a few more steps than just entering settings in the vBSEO CP.
There are 2 ways to so this. Most will use their own domain name. However, there are many advantages to using a 2nd domain name but it requires a few more steps (and possible root server access to your accounts).
Using the Same Domain as your vB/vBSEO Board
Most customers will likely use this method, as it is simpler to set up.
vBSEO Offers 2 methods for calling the CDN. Head on over to /vbseocp.php#cdn_opt on your site and you will see the basic set up options:
Using the Multiple sub-domain is the better choice, as it allows for more urls to pull for the WaterFall Effect parallelization across host names. In other words, instead of 4 files per time per domain that a browser normally loads, a user's browser will now load 20 at once (4 files from each cdn host name + the core domain). The end results is much faster page download speeds. And of course, that is before you take into account the global distribution of the CDN service itself. With multiple peers/servers in many places, the CDN will load large static files for users further away from your physical server faster. This also keeps that load off your main server, thus lowering your hardware requirements.
You should only use a single subdomain if you have a physical limitation on subdomains form your host (ie, only 1 subdomain is free with the account, etc)
As you can see in the above screen shots, I added example URLs that you should use for your paths. You can use ANY subdomain you wish here, provided it doesn't actually exist. (we'll create it soon). 'static' 'cdn' 'img' 'script' and so forth are all generic terms that you can use to your liking with meaning. These will appear in your source code, and the shorter the better so you may wish to use 'a' 'b' and 'x' for your subdomains. These urls will show close to 100 times in source code per page load on an average forum, so every letter you add ads about 100 bytes to the page size. This is nit-picking, but it's something to be aware of from the start.
Note that all settings require a trailing slash. And if you are installed in a folder, you should append said folder, ie http://images.domain.com/forums/.
Now, open up a new tab/window and head over to your CDN account https://login.maxcdn.com/account and log in.
First, you need to make a Pull zone.
Click on Manage Zones from the top nav
Click on Create Pull Zone in the top left quadrant.
Fill in the settings:
Pull Zone Name: "website: Forum CDN" works. Anything you want to call this CDN area. You will LABEL the account at the bottom.
Origin Server Url: This is your main website url of your forum. http://www.mydomain.com/ (include any path /folder/, ie http://www.mydomain.com/forums/) Advanced users may wish to set up an origin subdomain to control caching/etc at the server-level, and you may wish to use http://cdn-source.mydomain.com for example here. Most users should simply enter the main .com
Custom CDN Domain: This is your 'first' cdn subdomain. You can create more (if using multiple) later in the settings. Enter something like "static.mydomain.com" or anything else that you want your 'main' subdomain to be. No http://.
Label: This is the name of this zone. "Mywebsite CDN" is a good label.
Compression: Check this to enable gZip.
Click on Create and the zone will now provision. This may take a minuet or so.
While this runs, head over to your server/hosting account control panel in a new tab/window. You now want to make the CDN subdomain CNAME records.
Each host has different set ups for this.
In cPanel, it is called Simple DNS Zone Editor.
Once you find this, go back to your MaxCDN portal, as it should be completed now. You should see a message similar to:
Click on the Manage Pull Zone link in this message.Pull Zone has been successfully created. Manage Pull Zone
Please create a CNAME record for static.mydomain.com to xxxxx.acountname.netdna-cdn.com
Click the Settings tab.
Under Custom Domains, click on edit.
Click the plus sign to add a new row.
Here we will add in all of our subdomains (images, avatars, static, etc as defined in the multiple subdomain image)
Repeat clicking the plus sign until all your subdomains are created.
Click update when done. It will process.
Each we will now CNAME back MaxCDN to what is given to you in the blue bar at the bottom.
Head back over to your host CP DNS area and enter in the CNAMES
For the name, you need to enter each subdomain with a trailing dot, ie,
And the cname should be your url offered in the blue box from the settings pane.Code:images.mydomain.com.
Note, this doesn't always copy/paste over without a space so you may need to back-space it out before you save the CNAME.
It should look something like this:When you are done, you should have a list like this (account names edited, as this is from one of my live sites)Code:cdnname.accountname.netdna-cdn.com
It may take a few for DNS to propagate out, but almost always it works immediately.
To test, load a simple graphic, such as
from the breadcrumbs in vb4. Call it using your new cdn.Code:http://www.domain.com/images/misc/navbit-home.png
If this loads, your CDN is operational!Code:http://images.domain.com/images/misc/navbit-home.png
If it doesn't, you may need to wait for DNS to propagate. Check back in a little while.
Double check all of your steps, paths, and cnames as well. You may wish to wait a bit longer as well to make up for any global traffic as well, as it can still take up to 24 hours for these to go into effect elsewhere, even though it looks ok for you.
If you are using a non-www to www or similar htaccess redirect, you need to ALLOW these subdomains access.
See: [How to] Setup www.yourdomain.com or yourdomain.com (www vs. non-www) - With .htaccess 301 redirects and scroll to the 'Making Exceptions' header. You will need to add an exception for each subdomain that you CNAME.
Don't worry about duplicate content. As your site will now load from these subdomains, they are robots.txt'ed out at the CDN level. Additionally, the CDN includes a header on all requests that identify it as a CDN which bots/etc are capable of reading.
If you are operational, it's time to put your site live. Go back to the vbseoCP tab and save your CDN settings.
This will convert your vB board to call images, scripts, etc from the CDN url instead of your main .com.
Test your site completely to make sure everything works. If you lose style immediately, you did something wrong and you should disable the vbsseoCP option for the CDN immediately (uncheck the checkboxes next to each replacement).
Finally, you want to set up the advanced settings on the CDN.
I recommend the following set up:
Each setting requires its own 'update' click per setting, so make sure you go line by line.
That's all. You are now serving all your static content from the CDN.
Being on the same domain name, however, all cookies will still be attached to every static item. For the ultimate in performance and speed, using a secondary domain name is the way to go.
Using a Secondary Domain Name
This method requires a little more work and likely root access to httpd.conf.
This is for advanced users only. I will be FAR more brief and assume you know your way around your server.
This set up uses almost the same 'core' settings as above, with the exception that you will use cnd.someotherdomain.com instead of your forum domain, and you need to point that account at the same file set of your main domain and edit this domains DNS instead of the core account.
I used one of my parked domains. You likely have one when you bought the .net .org .biz or .info of your domain to protect competition and it's doing nothing. You may even wish to purchase a new domain just for this purpose, like mysitestatic.com /etc.
Whatever domain you chose, you need to set up it's own account on your server. It must be un-parked and have it's own account.
But, instead of letting it run its default /home/sitename/public_html/ for its path, you want to change this to your main website's path, ie /home/maindomain/public_html/
This can't be done from cPanel to the best of my knowledge of it and needs to be changed via ssh'ing into your server and editing the httpd.conf file, and then running the distiller tool to save the settings back to easyApache (may not be necessary on non-cpanel systems).
It may also be necessary to restart apache service so it takes effect.
You of course need to create the CNAME entries on THIS domain name to MaxCDN.
And you also need to adjust the vbseoCP settings to use this domain name as well.
This saves all the cookie load as there are NO vb/analytics/etc cookies attached to each of the static files from this domain.
Limitations:
Attachments in private forums will not work. If you have any staff or other non-guest viewable forums that use attachments, you should not use the attachment option on the CDN.
This is an area we are looking to improve for a future vBSEO release to get around the vb permissions to serve a CDN url or not.
There may also be some other misc static items that are not picked up by the replacement rules that do not conform to standard markup or are hidden within other elements and thus are missed by our replacement engine. Please keep in mind that this is the first iteration of this product and it will only get better and faster with every version of vBSEO to come.


50Likes
LinkBack URL
About LinkBacks











Reply With Quote



