Optimizing initial Fullcalendar JSON event data load
I currently have fullcalendar setup such that it uses a JSON data feed for populating events. Recently I have been going through my site and trying to optimize pa开发者_如何学Cge load times. In looking at the page that has fullcalendar, it takes 1-2 seconds to render the initial page, then the ajax query to return the event data takes another second or two. So I was wondering if it would be possible to initially populate the event parameter with the data of the current week on the initial request (eliminate the need for the initial AJAX request), then somehow change that such that anytime the user switches to a different time period in the future, it would retrieve the JSON data as usual?
An easy way would be to use two different event sources: 1 local, 1 json feed - see http://arshaw.com/fullcalendar/docs/event_data/eventSources/
This has two drawbacks:
You would need to configure your server in a way that if the initial displayed timespan is requested, no events get returned (otherwise they would be displayed two times).
You would still have the initial ajax call, but without any effect (the server would return an empty array, see above - while the initial dataset is already present in the local event source).
精彩评论