views:

52

answers:

4

some pages that use macros like:

topusers or popularlabels

are really slow to load. Is there any way to have this load asynchronously through ajax instead of having this block the initial page load ?

A: 

Maybe google analytics approach will help you.

(function() {
    var delayed = document.createElement('script');
        delayed.type = 'text/javascript';
        delayed.async = true;
      delayed.src = 'URL_AD_SERVER';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(delayed);
})();

However, I don't know how will work for dependencies :)

Ionut Staicu
A: 
ocdcoder
+1  A: 

If you consider using jQuery library, it has build-in support for asynchronous ajax requests.

yoda
asynchronous asynchronous javascript and xml? is that different from asynchronous javascript and xml? (I know I'm being pedantic)
advs89
A: 

Hi,

The Future macro is absolutely 100% the best way to do this.

We use it massively on a Confluence 2.10.3 instance to speed up everything, but I haven't tested it with more recent versions.

https://labs.atlassian.com/wiki/display/FUTURE/Home

I made a little video showing it working - reaching out to a SharePoint server to render a document list. This is not a perfect demo but gives you an idea of what it does.

I made a video of this too, but don't have the StackOverFlow rep to post it here yet so here is part of the URL screencast.com/t/tz8xdSCQYxp

Brendan

Brendan