Skip to content

Option to compress data in dcc.Store #3452

Closed as not planned
Closed as not planned

Description

@datenzauberai

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

  1. HTTP compression, but this is only addresses sending data from the server to the browser. Most browsers won't compress request bodies.
  2. 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 input data = orjson.loads(zlib.decompress(compressed_data.encode("latin1"))).

Activity

  1. datenzauberai commented on Aug 26, 2026

    @datenzauberai
    ContributorAuthor

    The network transfer for all data (not only dcc.Store) can be significantly reduced now that the PR for #3924 has been merged.

    While I think that it would be still useful to have this option, the implementation for this does not neatly fit into the current code base, because it would need to be implemented in the general callback code, while being a problem that should really be handled by code that is specific to dcc.Store.

    I think it would be much better to have callback hooks as proposed by @BSd3v in #3471 and then this could be implemented using such a hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogfeaturesomething new

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions