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

static.xxx.tld

Discussion in 'XenForo Questions and Support' started by ChemicalKicks, Aug 27, 2011.

  1. ChemicalKicks

    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?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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 likes this.
  3. ChemicalKicks

    ChemicalKicks Well-Known Member

    Thank you so much, so the first one I literally just leave as "$config['externalDataPath'] = 'data';"
     
  4. ChemicalKicks

    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.
     
  5. ChemicalKicks

    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?
     
  6. ChemicalKicks

    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.
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.
     
  8. ChemicalKicks

    ChemicalKicks Well-Known Member

    Done this but I can see by the pingdom report a load of style stuff being served from my normal domain.

    Thanks for that, I've updated all 30+ paths :eek:

    :)
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Got any examples?
     
  10. ChemicalKicks

    ChemicalKicks Well-Known Member

  11. Jake Bunce

    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 likes this.
  12. ChemicalKicks

    ChemicalKicks Well-Known Member

    Yeah it's odd that it's using the default paths because I'm not using the default style. Thanks again Jake!
     
  13. ChemicalKicks

    ChemicalKicks Well-Known Member

  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    There is no such option. Full attachments are served from internal_data and there is no option for an internalDataURL.
     
  15. ChemicalKicks

    ChemicalKicks Well-Known Member

    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.
     
  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Is it the thumbnail or the full image? That would make a difference.
     
  17. ChemicalKicks

    ChemicalKicks Well-Known Member

    Full image.
     
  18. ChemicalKicks

    ChemicalKicks Well-Known Member

  19. Jake Bunce

    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.
     
  20. ChemicalKicks

    ChemicalKicks Well-Known Member

    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? :)
     

Share This Page