Very slow loading of calendar events, any optimization method?

I have a calendar that works successfully, but the download time is very slow. Each event is successful, but the user must wait a good 5-10 seconds when switching views or navigating by month / week / day.

I showed the event loading code below, is there anything I can do to load it faster?

thanks

<script type='text/javascript'> $(document).ready(function () { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); var calendar = $('#calendar').fullCalendar({ //events: [{"title":"My Test Event","start":"Wed, 02 Nov 2011 13:00:00 EST","url":"http://edu","allDay":"false"}], events: "JSONcalendarFeed.aspx", defaultView: 'month', weekends: false, allDay: false, minTime: 8, maxTime: 19, allDaySlot: false, slotMinutes: 15, weekMode: 'liquid', defaultEventMinutes: 60, firstHour: 8, header: { left: 'month,agendaWeek,agendaDay', center: 'title', right: 'prev,next today' }, eventRender: function (event, element) { var evtDesc = event.description; var evtStart = event.start; var evtEnd = event.end; if (evtDesc || evtStart) { element.qtip( { content: evtStart + ' - ' + evtEnd + '<br/>' + evtDesc, position: { corner: { target: 'bottomMiddle', tooltip: 'topMiddle' } }, style: { name: 'light' } } ); } }, selectable: true, selectHelper: true, select: function (start, end, allDay) { var title = prompt('Event Title:'); if (title) { calendar.fullCalendar('renderEvent', { title: title, start: start, end: end, allDay: false, weekends: false }, true // make the event "stick" ); } calendar.fullCalendar('unselect'); }, editable: true }); }); </script> 
+4
source share
1 answer

To summarize the comments:

Do not send all events from the feed, but only those that occur between the beginning and the end, which are parameters sent by fullCalendar to the feed page. They are sent as unix timestamps in seconds .

+5
source

Source: https://habr.com/ru/post/1383677/


All Articles