Hi @mishav,
Thanks for the reply. The calendar of course does need to get events from the database. What I do is load them into what I think of as “pre-loaded” Custom States. (In fact, I have to do this as some of the event data comes from my API which parses iCal URLs and returns all the events as a list of events — this has the problem of that data type, the events that come back from the API, are not “savable”.)
I do not, of course call the API synchronously, BTW, the values are already stored.
The values are filtered by only those events > current date/time. And even that filtering is done before reaching the page (it’s part of the API workflow). Point is, there is usually NOT a large amount of data being loaded. That part does not seem to be the bottleneck.
There are, of necessity, a couple of merges that must happen to the event values. But again this is lightweight.
I have experimented with :make static in this case and it seems to have no effect. (Not on oerformance and ALSO, not on the data shown.).
In fact, if the data changes while one is on the page (say, an event is added or the API to update the events by parsing an external iCalendar URL is called), the new events will show up in the calendar. I find this odd, but that’s what happens. I’m not sure WHEN :make static actually does what the reference says it does.
I’ve PM’d you a link so you can see for yourself how it behaves on loading. If you’re up for looking at my code I could send you that as well. There’s some clever stuff that I do with the JS to Bubble elements.
One thing that IS slowing this page is the calendar dates are clickable. That element a shape to take the clicks, has a large number of conditional states to figure out “is this day available or is it already booked?” “is this day selectable as the end date for the reservation?”, etc.
That “booked or not” condition is pretty complex as it invokes a :filter with Advanced criteria like “event’s start<-range->event’s end contains parent group’s date” (which is the calendar date in the RG that forms the calendar).
That condition evaluates slightly slower than the alternative way: If I load a list of individual dates and key off “List of Booked Dates contains parent group’s date”, that speeds things up A TOUCH. And that’s how I used to do it, but then I realized that a list of such dates is not necessary.
Anyway, Bubble can be weird sometimes.