Issue 1822: More aggressively cache/pre-fetch events from AJAX calls
Status:  ExportedToGithub
Owner: ----
Closed:  Aug 2015
Reported by koniczy...@gmail.com, May 4, 2013
Hello,

Maybe I understand lazyFetching wrong or I remember it working wrong, but from what I recall if I had this lazyFetching set to true (by default) and switched weeks in weekAgenda view, calendar fetched each week only once. Right now it fetches weeks all the time (when I switch back and forth). Shouldn't it keep events in memory?

Kind regards,
Mike
Aug 24, 2013
Project Member #1 adamrs...@gmail.com
nah, it never worked like that. It's a little difficult to describe, but when an event fetch needs to happen, all cached events get erased, so when navigating to a week that doesn't have events yet, it invalidates the cache for all other time periods.

what you describe is a potential feature however.
Summary: More aggressively cache events from AJAX calls (was: Full calendar fetches events even if it has them in memory)
Status: Accepted
Labels: -Type-Defect Type-Feature
Aug 24, 2013
#2 koniczy...@gmail.com
If you say so, I believe you ;)

If you could put this on a feature list it would be great, as it should work like I described from the start (in my opinion of course ;) )

Regards,
Mike
Aug 25, 2013
Project Member #3 adamrs...@gmail.com
 Issue 1935  has been merged into this issue.
Aug 25, 2013
Project Member #4 adamrs...@gmail.com
 Issue 1950  has been merged into this issue.
Aug 25, 2013
Project Member #5 adamrs...@gmail.com
(No comment was entered for this change.)
Summary: More aggressively cache/pre-fetch events from AJAX calls (was: More aggressively cache events from AJAX calls)
Jul 3, 2014
#6 Catholic...@gmail.com
I've implemented caching and prefetching for my calendar application. A brief summary of the functions in my implementation:
(1) When an event source for a given time period is to be fetched via AJAX, it is added to the cache list as pending (to avoid fetching the same data twice)
(2) When an event source has been retrieved by any method, it is immediately processed (in my use case, that includes application of a filter, so that successive months in a datepicker plugin can be immediately populated according to the days on which special events are visible according to the current filter), and then added to the cache.
(3) When an event source is to be fetched, the cache is checked for a copy that contains the requested date range for that source. If a cached copy exists, it is
returned. (Currently no expiration of cached data is implemented; being stored in
variables, the data will only last for the session). If it is already being
prefetched, and should now be fetched for display, the fetch in progess is
modified so that upon completion the data is passed to the renderer.
(4) When an event source is to be displayed for a given time period, or a direct request is made to fetch that event source for that time period, an additional and
configurable number of time periods may be queued for prefetching. (The queue itself can be configured to wait for a certain duration of inactivity before making the prefetch, or until there are no more than a configurable number of pending ajax requests.)

Additional functions present in the code, which are not essential to caching and prefetching:
(5) Since in my use case, prefetch events are used to update the datepicker, the number of pending prefetch requests are tracked, so as to trigger a refresh only when no more requests are pending, or when otherwise idle.
(6) The time taken to process fetchs is recorded, to more effectively limit processing to otherwise idle periods. (Not yet implemented.)

The code is not the cleanest code, but gets the job done, and may be useful to someone else in need of similar functionality. The implementation can be seen live 
at: http://www.erloeserkirche.at/termine_in_neustadt.html
fullcalendar_custom.js
208 KB   View   Download
fullcalendar_gemeinden.js
210 KB   View   Download
May 12, 2015
#7 u01jmg3
Will this functionality ever become part of the core library? Looking to implement pre-fetching and want to know (as this thread was last updated almost a year ago) how best to achieve this?
Aug 21, 2015
Project Member #8 adamrs...@gmail.com
Discussion for this issue has moved to the following URL:
https://github.com/fullcalendar/fullcalendar/issues/2089

This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event.

Happy coding,
Adam
Status: ExportedToGithub