As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 8 years ago.
I have a jsp page that has separate modules or widgets on it. To improve the overall load-time of the page, I was thinking of fetching those independent modules in parallel.
I have 2 strategies :
1: JQUERY AJAX
function getSimilars(){
$('#similars').load('getSimilars.jsp');
}
function getActivity(){
$('#activity').load('getActivity.jsp');
}
$(document).ready(function(){
var funcList = ['getSimilars','getActivity'];
$.each(funcList, function(i,v){
window[v]();
})
});
2: STATIC INCLUDE
I know that 1 runs from the browser while 2 runs during compile time. But which of these would make my page load faster?
EDIT:
While the jquery method runs both function in parallel, I think the 2nd method makes those 2 includes run serially. Am I right ?