• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

static.xxx.tld

ChemicalKicks

Well-known member
#1
Hopefully your search will lead you here.

So say you're set up static.xxxx.tld for your site because you've read somewhere you can get speed improvements. What do you actually need to do with your xenforo installtion?

How do you reference the static. domain? Where do you enter the filepaths?

For the love of all that's RICHARD DAWKINS how do I do it?
 

Jake Bunce

XenForo moderator
Staff member
#2
Add these to your library/config.php file:

Code:
/**
 * Relative path to the thumbnails / avatars (etc.) directory from the base installation directory.
 * Must be web accessible and server-writable.
 * Examples 'data', 'foo/bar/data', '../path/to/thingy'.
 */
$config['externalDataPath'] = 'data';

/**
 * URL to the thumbnails /avatars (etc.) directory. Can be relative or absolute, but must
 * point to the web-accessible location referred-to by $externalDataPath.
 */
$config['externalDataUrl'] = 'data';

/**
 * URL to the location where XenForo's Javascript directories are located.
 * Can be absolute or relative.
 */
$config['javaScriptUrl'] = 'js';
If you want a cookie-free domain then you would specify a full URL for the last two settings and leave the first one alone. The cookie-free domain should be parked on the same site. You don't need to move any files. See this thread for reference.

For the style images you need to edit this setting to specify a full URL:

Admin CP -> Appearance -> Style Properties -> General -> Path to Images

The smilies also have their own individual paths:

Admin CP -> Home -> Smilies -> Edit
 

ChemicalKicks

Well-known member
#4
This is what I've done.

PHP:
/**
* Relative path to the thumbnails / avatars (etc.) directory from the base installation directory.
* Must be web accessible and server-writable.
* Examples 'data', 'foo/bar/data', '../path/to/thingy'.
*/
$config['externalDataPath'] = 'data';

/**
* URL to the thumbnails /avatars (etc.) directory. Can be relative or absolute, but must
* point to the web-accessible location referred-to by $externalDataPath.
*/
$config['externalDataUrl'] = 'http://static.the-sps.org/data';

/**
* URL to the location where XenForo's Javascript directories are located.
* Can be absolute or relative.
*/
$config['javaScriptUrl'] = 'http://static.the-sps.org/js';
Everything appears to be working.
 

ChemicalKicks

Well-known member
#5
Thank you for pointing me in the right direction.

So far I've edited the config as above and I've changed the relative path to point to the static domain in General Style Properties, is there anything else I need to do?
 

ChemicalKicks

Well-known member
#6
Looking at a Pingdom Tools report I can see all the js and data being served correctly but all the style stuff is being served from the www. I'm missing something here.
 

Jake Bunce

XenForo moderator
Staff member
#7
So far I've edited the config as above and I've changed the relative path to point to the static domain in General Style Properties, is there anything else I need to do?
Oh yeah. For the style images you need to edit this setting:

Admin CP -> Appearance -> Style Properties -> General -> Path to Images

The smilies also have their own individual paths:

Admin CP -> Home -> Smilies -> Edit

I have updated my original post.
 

ChemicalKicks

Well-known member
#8
Oh yeah. For the style images you need to edit this setting:

Admin CP -> Appearance -> Style Properties -> General -> Path to Images
Done this but I can see by the pingdom report a load of style stuff being served from my normal domain.

The smilies also have their own individual paths:

Admin CP -> Home -> Smilies -> Edit

I have updated my original post.
Thanks for that, I've updated all 30+ paths :eek:

:)
 

Jake Bunce

XenForo moderator
Staff member
#11
All of those images that are flagged by pingdom are showing correct on the forum itself. They are all being served from static.the-sps.org despite what that site says.

Maybe the results are cached. Or maybe it's using the Default style instead of the Infinite style somehow.
 

Jake Bunce

XenForo moderator
Staff member
#19
Looks good to me. The thumbnails are being served from the static domain while the full images are not. That is the correct behavior.