XF 2.1 jQuery CDN setting - help!

Jon12345

Well-known member
I notice under Setup > Options > Performance, there is a jQuery source option. Currently, I have it set to Locally hosted. However, I am using a CDN with the following settings in config.php:

Code:
$config['externalDataUrl'] = 'https://cdn.access-programmers.co.uk/forums/data';
$config['javaScriptUrl'] = 'https://cdn.access-programmers.co.uk/forums/js';

So now I am confused! Am I still using it locally? Or am I using the CDN for jQuery? If I am using the CDN fo jQuery, do I need to change the setting from Locally hosted to CDN, or does it make no difference?
 

Jon12345

Well-known member
This is where it gets confusing, because if I look at my CDN logs, it shows this:

1580733138139.png
While my settings are set to local, my CDN logs are showing it in the CDN.

So if my website is using it locally, how come it is shown logged in my CDN?
 

Kevin

Well-known member
So if my website is using it locally, how come it is shown logged in my CDN?
You want to have it as "local" and then use the CDN settings like you already are. The option in the ACP is simply asking if you want to use the copy of the library from your XF install or if you want to use the copy served by Google's CDN or other. In this case you are using the "local" copy from your XF install but your local copy of your XF install happens to be using a CDN.

This can be verified by using Chrome's dev tools and then viewing the location of the files being served.

1580760661131.png
 

Kevin

Well-known member
You want to have it as "local" and then use the CDN settings like you already are. The option in the ACP is simply asking if you want to use the copy of the library from your XF install or if you want to use the copy served by Google's CDN or other. In this case you are using the "local" copy from your XF install but your local copy of your XF install happens to be using a CDN.

This can be verified by using Chrome's dev tools and then viewing the location of the files being served.

View attachment 217757
What is the jQuery CDN option for?
As mentioned, it's just a way of specifying whether to serve jQuery from your XF install or from Google's CDN (or Microsoft's CDN, or jQuery's CDN).

If you're still not sure, here's an old (old, old, very old) conversation about what the option is and the benefits of using Google's CDN or somebody elses.
 

Jon12345

Well-known member
I was thinking the jQuery CDN is for me to set up jQuery using my own CDN. Are you saying that there is some CDN out there that is free that will run the jQuery?

Edit: Just Googled it. I see it now, it is free!
 
Last edited:
Top