CC-4873: Airtime takes 7 seconds to load 32K (very small) from db

-we know what month will be the initial view for the user.
-Provide this data ahead of time.
This commit is contained in:
Martin Konecny 2013-01-24 12:13:55 -05:00
parent 548b73db42
commit 091f5ff49f
3 changed files with 50 additions and 12 deletions

View file

@ -326,19 +326,26 @@ function eventResize( event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, vie
});
}
var initialLoad = true;
function getFullCalendarEvents(start, end, callback) {
var url, start_date, end_date;
start_date = makeTimeStamp(start);
end_date = makeTimeStamp(end);
url = baseUrl+'Schedule/event-feed';
var d = new Date();
$.post(url, {format: "json", start: start_date, end: end_date, cachep: d.getTime()}, function(json){
callback(json.events);
});
if (initialLoad) {
initialLoad = false;
callback(calendarEvents);
} else {
var url, start_date, end_date;
start_date = makeTimeStamp(start);
end_date = makeTimeStamp(end);
url = baseUrl+'Schedule/event-feed';
var d = new Date();
$.post(url, {format: "json", start: start_date, end: end_date, cachep: d.getTime()}, function(json){
callback(json.events);
});
}
//TODO: Look at the type of calendar view...we may be returning too much information
}
function checkSCUploadStatus(){