How big can the Context/pageData be?

As we are continuing to develop and add new features to our Losant Experiences, our backend team is left wondering what are the limits to stuffing more JSON data into what I think is called the context?

It is what gets exposed as pageData when you have the Render Page node in a workflow.

An example of this is that for a device navigation bar, on the left column, we adjusted our devices to nest based on a hierarchy we have. So we end up with something like…

pageData:
navigation:
company:
0: company1
name: "company1
locations: 9 elements

Thats some pseudo code of course, but we end up with several companies, each having their own arrays of locations, sublocations, assets and finally sensors, all devices in the dashboard.

Then we throw another json object containing all events. Then maybe we throw another device list in there because sometimes a flat device list is easier to traverse/search than the nested one we used for the nav.

Collapsed, it looks like:

pageData
navigation
events
flattened_device_list

but once expanded all out, it is quite large.
And this is the point of my question. Its been easy so far to just make everything available to all pages.
Do we need to be more targeted about what each page receives in its pageData?

Will we ever hit a limit of too much data, or does it just begin to slow things down the larger that pageData gets?

Sample Screenshot to give context to what I am talking about, in actuality we have flows that put more objects into pageData than what is shown here:
image

Hey @Kyle_Stokes2,

The size limit of a page context is 256KB when gzipped. Losant will gzip your context before passing it to your pages to be rendered. Because of the gzip process, it’s hard to determine the actual underlying limit because different contexts will gzip with different ratios.

JSON, which is used to represent the context, typically has a pretty high compression ratio (3-10x). This means the underlying context can potentially be several megabytes in size.

The resulting rendered page has the same limit of 256KB when gzipped. HTML has a similar typical compression ratio as JSON, so the resulting page can also potentially be several megabytes in size.

If you want to test the size of your context, the easiest way would be to use the copy-to-clipboard feature in the render log. You can then paste the context into a text file and save it. The size-on-disk of the resulting text file will be a good representation of the pre-gzip size of your context.