So, here’s something that seems to be affecting performance on certain of my pages. I have a site/app with "Listing"s for rentals. The Listing data type object is, of course, quite complex. It contains text info (descriptive stuff), links to other objects (like calendars, which in turn have event objects within them), lists of photos, etc., etc.
I would have thought, given the Bubble metaphor of pages being able to have a “type” (and this being the main and easiest way to create dynamic pages that present certain data from objects of that type) that Bubble would be “smart” (or at least “smart”-ish) about what data gets received by the page.
What I’m finding is that, if I build a page is of type “Listing” that only makes use of a few of the Listing’s attributes (in my specific case, I’m displaying a calendar associated with the Listing in question, which really only accesses the Listing’s associated Calendars and the events within those Calendars), there’s a whole ton of data that is still received by the page.
This became obvious to me when comparing performance on this particular page when a user is logged in, versus when they are not logged in. In the Logged In case, the page receives much more data as Privacy Rules “unlock” access to more data. When one is Logged Out and views the page, a much smaller amount of data is loaded.
Similarly, some Listings are larger and more complete than others. A Listing for which there are no photos or descriptive data (but which might have a calendar associated with it) will load less “phantom”/“unreferenced” data than a more complete Listing.
Because the “Listing” type is so expansive, what I’m finding is that my “simple” calendar display page can, in certain cases, be loading HUNDREDS of Megabytes of data – none of which I’m actually “using” or referencing in the page.
This just strikes me as really strange, as the Bubble development paradigm encourages you to build pages based on object types. So that (for example), I have many different kinds of pages that are of type “Listing”, but that perform different functions. For example:
A “view_listing” page that shows photos, descriptive text, calendar availability, etc. to prospective renters.
Administrative pages where the owner of a listing enters information, uploads photos, links calendars, etc.
Pages like a “booking-widget” page (what I’m talking about above) that show calendar availability, but none of the other stuff.
And then the URLs for these pages, of course, all end with the same unique ID (the unique ID of the Listing in question).
Here’s my question/issue: When one “sends data to a page” (that is the page object has a data type like Listing) I would have assumed that “sending data” was kind of metaphorical. That what one is actually doing, is sending a POINTER to potential data used in the page. (Like, Listing is just a handle that one can conveniently grab to access data: e.g., “Current Page’s Listing’s Short Title”.)
But this seems to not be the case. Simply referring to a large data object in this way, really DOES cause a bunch of potentially unneeded stuff to load. This doesn’t make much sense to me.
How do longtime Bubbler’s deal with this?
I guess the workaround is NOT to use objects of that data type. Instead of “send data Listing to page X” one would “send data Listing’s uniqueID to page X” and only grab what one needs? This seems to make things much harder than they should be…