-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Is your feature request related to a problem? Please describe.
As also noted in #2123 the stateless architecture can result in a lot of data that is being stored in the client. We find that network transfer of these states alone can be the culprit for sluggish applications when a request has to transmit 1 MB of state data... A redesign that avoids this data transfer is not always easily possible.
Describe the solution you'd like
It would be great, if the dcc.Store component had an option to automatically store the data compressed in the browser. The cost of compressing and decompressing on the server side is normally really low and the reduction in size is often huge. A limitation might be that client-side JavaScript would not easily be able to manipulate the data without decompressing it.
Describe alternatives you've considered
- HTTP compression, but this is only addresses sending data from the server to the browser. Most browsers won't compress request bodies.
- Manual compression/decompression, which works quite fine. Output
compressed_data = zlib.compress(orjson.dumps(data, option=orjson.OPT_NON_STR_KEYS)).decode("latin1")
to the store and decompress the inputdata = orjson.loads(zlib.decompress(compressed_data.encode("latin1")))
.