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

XF 1.4 Use cookie-free domains => config.php

Betclever

Active member
#1
Hello all,

I'm trying to optimize my Xenforo forum and when I made a test with GT Metrix, it showed me a lot of things under "use cookie-free domain".

What must I do with this?
I have seen a lot of posts with this but shall I add some lines in the file config.php and add a subdomain?

If yes, can someone tell me what must I do to do this please?

Regards,
 

Coop1979

Well-known member
#2
Here is a way to move your /data and /js folders to a cookieless domain (add to config.php)
Code:
$config['externalDataUrl'] = 'http://cdn1.yourdomain.com/data';
$config['javaScriptUrl'] = 'http://cdn1.yourdomain.com/js';
What items specifically was it telling you to put under a cookieless domain?
 

Betclever

Active member
#3
Here is a way to move your /data and /js folders to a cookieless domain (add to config.php)
Code:
$config['externalDataUrl'] = 'http://cdn1.yourdomain.com/data';
$config['javaScriptUrl'] = 'http://cdn1.yourdomain.com/js';
What items specifically was it telling you to put under a cookieless domain?
Avatar, node icon,...
Actually, I have chosen Google as CDN, is this a good one?

I have just checked the box Google Ajax API CDN under "performances" on the CP but must I create an account?
Is Google enough or must I use Amazon S3?

Regards,
 

BobbyWibowo

Well-known member
#4
This thread is more than one month old already, but I'm quite curious as well.
How's it on your end @Betclever ? Ticking the CDN option on Performance will only choose which CDN to use to server jQuery library. It won't affect any other files. The suggestion that Coop1979 suggested would probably solve it, but you'll need a proper CDN.
 

Betclever

Active member
#5
This thread is more than one month old already, but I'm quite curious as well.
How's it on your end @Betclever ? Ticking the CDN option on Performance will only choose which CDN to use to server jQuery library. It won't affect any other files. The suggestion that Coop1979 suggested would probably solve it, but you'll need a proper CDN.
I made 2 subdomains and added those lines into the file "config.php" and it is okay and this increased performances.
However, I'm looking a way to increase performance for the page speed cause the loading average "first time" is more than 5 seconds and my website should be optimized but according to GTmetrix, not enough...
Therefore, I'm checking for a good CDN and I think, I will try a free one like S3 Amazon "Free for a limit of requests" but I don't know what exactly I need cause my forum generates a lot of trafic but the total of members is poor.

Can you advise me something?
Regards,
 

BobbyWibowo

Well-known member
#10
Any domain that's registered under CloudFlare will have CF's security cookie appended on the root domain. Meaning, access to any sub-domain will make the client send that security cookie from the root domain (so it's not cookieless). Can I serve a cookieless domain or subdomain through CloudFlare? – CloudFlare Support

MaxCDN, KeyCDN or any other should be able to server cookieless domain as long as you're not using CloudFlare on the root domain, I believe.
 

rafass

Well-known member
#18
Too bad Incapsula doesn't have SSL support on the free plan though.
Exactly. I'm looking other options now.
KeyCDN is free for 30 day trial, and only costs me around $6 per month for ~150Gb traffic.
Hello Mouth, what is the best option in the case of cookie free domain?
Decide what type of Zone you want to use:
  • Push Zone if you want to upload the files to our CDN
  • Pull Zone if we should get the files from your origin webserver directly
Edit, I'll try first with Pull Zone :coffee:
 
Last edited:

BobbyWibowo

Well-known member
#19
Decide what type of Zone you want to use:
  • Push Zone if you want to upload the files to our CDN
  • Pull Zone if we should get the files from your origin webserver directly
Edit, I'll try first with Pull Zone :coffee:
You should definitely use Pull Zone if you want to integrate it with XenForo. As you'll be using XenForo's config option to reroute data and js path, then uploading the files manually is not an option. Data path includes the avatar and attachments as well, then I can't simply imagine you re-uploading all of them to the CDN, lol. Especially when someone uploads new files.