static.xxx.tld

ChemicalKicks

Well-known member
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
Add these to your library/config.php file:

Rich (BB 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
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
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
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
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
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
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.
 

ChemicalKicks

Well-known member
There is no such option. Full attachments are served from internal_data and there is no option for an internalDataURL.
It's strange.

Using chrome and right clicking to get the image URL I see the url above. Using pingdom tools shows the attachment being served from static.
 

Jake Bunce

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

ChemicalKicks

Well-known member
Looks good to me. The thumbnails are being served from the static domain while the full images are not. That is the correct behavior.
You continued support/knowledge is appreciated.

Do you know why the full images aren't served up from the static, it's by design but why? :)
 
Top