Forum Discussion

allensmith81's avatar
14 years ago

Activecast performance

Hi all,

 

We recently setup activecast on a custom page to display FAQ's., which are in a hidden board and I was wondering if anyone had any idea how to make it work faster. See our current implimentation and any suggestions welcome.

 

Allen

3 Replies

  • AdamA's avatar
    AdamA
    Khoros Oracle
    14 years ago

    Hello Allen,

     

    The Activecast components use JavaScript to make REST API calls against the Lithium hosted community to generate the content.  Since the contents of these compoents are not rendered server side with the initial page load there will be a delay between the page appearing to load and then the contents of Activecast components appearing as the JavaScript makes an additional roundtrip to the server to get the content.  This may explain part of the delay that you are seeing.

     

    One thing you could do to minimize the time between the entire page loading and the contents of the Activecast components rendering is to change the script code such that the script link is added in the head.

     

    The code would need to change from this:

     

    <head>
    ...
    </head>
    ...
    <body>
    ...
    <script type="text/javascript" id="lia-ac-lt-WebFAQs" src="http://devforum.skype.com/t5/activecast/latestthreadspage"></script>
    <script type="text/javascript">
    	LITHIUM.ActiveCast.getLatestThreads('WebFAQs', {
      "hrefTarget" : "_self",
      "parentElementId" : "lia-ac-lt-WebFAQs",
      "numSubjectWords" : 250,
      "displayNodeLabel" : false,
      "maxNumberOfMessages" : 50,
      "numBodyWords" : 0,
      "displayNodeTitle" : false
    });
    </body>
    

     

    To this:

     

    <head>
    <script type="text/javascript"  src="http://devforum.skype.com/t5/activecast/latestthreadspage"></script>
    </head>
    ...
    <body>
    ...
    <div id="lia-ac-lt-WebFAQs"></div>
    <script type="text/javascript">
    	LITHIUM.ActiveCast.getLatestThreads('WebFAQs', {
      "hrefTarget" : "_self",
      "parentElementId" : "lia-ac-lt-WebFAQs",
      "numSubjectWords" : 250,
      "displayNodeLabel" : false,
      "maxNumberOfMessages" : 50,
      "numBodyWords" : 0,
      "displayNodeTitle" : false
    });
    </script>
    ...
    </body>

     

    Please note that there is an additional "div" tag which has the "id" attribute that used to be on the script tag which references the JavaScript file.

     

     

  • AdamA's avatar
    AdamA
    Khoros Oracle
    14 years ago
    If there was someway to conditionally add the scripts to the head for the pages that use the Activecast feature that could work. If you do not have that much control then you might see if you could at least place the script includes higher up inside of the body tag on the pages that use the Activecast widgets.

    Another option might be to give feedback (via an image) that the content is being loaded.