Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

What happens if I disable the Google APIs script?

edited October 2013 in Vanilla 2.0 - 2.8

I have just installed Vanilla forums for the first time and there are many things that I like. However, one thing I don't like to do on my sites is run outside services such as Google APIs. When I disable the script in my browser, I can't find any features not functioning correctly, so I was wondering what this script is even supposed to do?

This is the script in the source:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>

Tagged:

Best Answers

Answers

  • Thank you, @peregrine, that is very helpful. Yes, I'm running beta version 2.1b1.

    I looked in files applications/dashboard/controllers/class.dashboardcontroller.php and library/core/class.controller.php and I could not find the disable CDNs statement. Am I supposed to add it? I did locate the jquery version at jquery.com, but I'm not clear on how to point the forum's scripts at it.

    While I was in applications/dashboard/controllers/class.dashboardcontroller.php I noticed that the forums are also using Google APIs for fonts.

  • I can see you point of view there are situation where i agree.

    What I would say though is google apis are cached much more often your site, and they are served fast too.

    It is somethign that has argument for and against and you should be able to choose.

    If you are in an Intranet, you should obviously be able to serve locally.

    grep is your friend.

  • peregrineperegrine MVP
    edited October 2013

    config statements are added or modified in your /conf/config.php

    there is very good documentation on this in the vanilla docs, the wiki, and the forum.
    I suggest a read them if you are at all interested in developing or understanding vanilla.

    yes the config statement controls CDN deliver for fonts as well as jQuery.

    the config change will effectively change the core program's loading locally versus remotely.

    $Configuration['Garden']['Cdns']['Disable'] = TRUE; /

    just add it to your config.

    Be aware that themers don't have to rely on this, and some themes make calls from all over the planet to other websites to get resources.

    Also some plugins will make calls to other sites

    If you are testing on a computer that does not have access to the internet. this is a good method to use. It also is good if you are trying test plugins and themes and see if they make calls to other sites.

    On the other hand, as x00 suggests there are downsides and upsides of controlling delivery and delivering common programs from your site rather than google etc.

    Although I doubt much other software besides Vanilla is relying on jQuery version 1.7.2 so making that local is a bit of a moot point.

    heres a cool link also....
    http://vanillaforums.org/discussion/17954/food-for-thought-forum-etiquette

    as well as the previously mentioned.

    http://vanillaforums.org/discussion/23130/forum-post-ettikett-etiquette

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @x00 This is something I feel should be an option, as you suggest, just like the buttons on comment boxes. I am very grateful that this free and wonderful software is available, seriously, it's just a little annoying to me when I'm forced to use outside services without being directly informed or having to enable them. It seems reasonable to me that there could be a plugin for enabling these outside services, with its description informing admins that this will increase the performance of the forums, reduce load on the server, but utilize and force users to make calls to outside services which may be using their header information for statistical tracking or other purposes.

    @peregrine Thank you again for your responses. I have looked through the documentation and the pages for the config file are all empty. Is the Vanilla wiki you refer to the one located at homebrew.net? I can't find one on this site or linked to from this site other than in forum posts. On that wiki I was unable to find any reference to utilizing local jQuery libraries or Google APIs. When I've tried to search these forums, Google, or Bing on this issue, there is just far too much noise for me to find anything useful, but perhaps I don't know the proper search terms.

    I added that line to my config file and I can see that there are no longer any calls to Google APIs, not even for the fonts. Is this the only action I need to take? In library/core/class.controller.php I see this:

    if (Gdn::Request()->Scheme() != 'https' && !C('Garden.Cdns.Disable', FALSE)) {
       $Cdns = array(
          'jquery.js' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'
          );
    }
    

    I'm just learning the tiniest bit of using PHP. Does the above statement mean that there is nothing being called with 'Garden.Cdns.Disable' set to TRUE? I realize you stated in your comment that adding the FALSE statement is all that is required, I was just trying to understand the PHP a little bit.

    Thanks for the heads-up on themes and plugins. I will be careful when I install these.

  • @openletter in fairness you are using a beta version, rather then the stable branch.

    grep is your friend.

  • @x00 Yes, perhaps there is a difference there. My understanding is there are quite a few new features in the beta and it is now fairly stable. Since I am looking at long-term switching, I felt I'd rather start with what the future of Vanilla is. At this point I certainly can't say what the typical stable versions look like, so I don't mean to imply that I know what the stable version builds typically look like.

  • @openletter said:

    if (Gdn::Request()->Scheme() != 'https' && !C('Garden.Cdns.Disable', FALSE)) {
       $Cdns = array(
          'jquery.js' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'
          );
    }
    

    I'm just learning the tiniest bit of using PHP. Does the above statement mean that there is nothing being called with 'Garden.Cdns.Disable' set to TRUE?

    That code block translates into "If we aren't sending this over https protocol and the configuration ['Garden']['Cdns']['Disable'] is set to false or nonexistent, add this request to the Cdns array. If it is set to True or we are on https, don't add the request."

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • peregrineperegrine MVP
    edited October 2013

    .

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @hgtonight Thanks for that. Now I understand why I wasn't initially seeing the calls from the dashboard - I installed and logged in through https.

Sign In or Register to comment.