-
QuestionQuestionHow can I disable compression of http data when running nicegui? Profiler shows my nicegui app spends a lot of time compressing data. It's not needed and contributing to lag. There's no obvious flag in the ui.run page, and the uvicorn.run args aren't clear (ws-per-message-deflate is the only option that mentions compression, but this doesn't seem like the right setting). Can't find anything relevant in issue discussions either. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
You are right. Currently the gzip compression middleware is non-optional because it's simply added when importing NiceGUI: Line 57 in 3fcfac6 We should move it to the |
Beta Was this translation helpful? Give feedback.
-
|
Looks like there's a new parameter to ui.run(): from here - #5582 . Good! Thanks! |
Beta Was this translation helpful? Give feedback.
You are right. Currently the gzip compression middleware is non-optional because it's simply added when importing NiceGUI:
nicegui/nicegui/nicegui.py
Line 57 in 3fcfac6
We should move it to the
ui_run.pyinitialization and introduce a configuration parameter. Would you like to create a pull request? Until it is merged you may be able to accessapp.user_middlewareand remove the middleware in your application code...