Back to General Articles

How to setup a CDN for vbulletin
by final kaoss 14 Jan 2011
Rating: (5 votes - 5.00 average)

To edit your vBulletin style to enable CDN, follow these steps:

* Open admincp by visiting http://mywebsite.com/admincp/ > Select Styles & Templates > Replacement Variable Manager:
* Click on [Add New Replacement Variable] link and set it as follows:
o Set Search for Text to href="clientscript
o Set Replace with Text to href="http://cdn.mywebsite.com/clientscript

Code:
You need to repeat this step for images, javascript and other shared media as follows:
Search for Text 	Replace with Text
src="customavatars/ 	src="http://cdn.mywebsite.com/customavatars/
src="customprofilepics/ 	src="http://cdn.mywebsite.com/customprofilepics/
src="images/ 	src="http://cdn.mywebsite.com/images/
url("clientscript 	url("http://cdn.mywebsite.com/clientscript
src="clientscript/ 	src="http://cdn.mywebsite.com/clientscript/
href="clientscript/ 	href="http://cdn.mywebsite.com/clientscript/
url(./images/ 	url(http://cdn.mywebsite.com/images/
url(images/ 	url(http://cdn.mywebsite.com/images/
var imgdir_misc = "images/misc"; 	var IMGDIR_MISC =    "http://cdn.mywebsite.com/images/misc";
Avatars & Pictures - Storage Type

* Visit Avatars > Storage Type and set them as follows to match your above CDN rules by moving all of them to file systems:
o Avatars are currently being served from the filesystem at ./customavatars
o Profile pictures are currently being served from the filesystem at ./customprofilepics
o Signature pictures are currently being served from the filesystem at ./signaturepics

How Do I Test Images And Other Media Files Are Cached Or Not By CDN? Use curl to test HTTP headers (look for Etags, max-age and Expires headers):

Code:
$ curl -I 'http://cdn.mywebsite.com/clientscript/vbulletin_important.css?v=385'
$ curl -I http://cdn.mywebsite.com/customavatars/avatarx_y.gif
Credit for this nice & short tutorial goes to these guys.
http://wiki.netdna.com/Implementation/vBulletin

vblts.ru supports vBulletin®, 2022-2024