Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable compression in functions #29

Closed
falquaddoomi opened this issue Apr 18, 2024 · 2 comments · Fixed by #28
Closed

Enable compression in functions #29

falquaddoomi opened this issue Apr 18, 2024 · 2 comments · Fixed by #28
Assignees

Comments

@falquaddoomi
Copy link
Collaborator

No description provided.

@falquaddoomi falquaddoomi self-assigned this Apr 18, 2024
@vincerubinetti
Copy link
Collaborator

vincerubinetti commented Apr 22, 2024

As best I can tell, Flask doesn't do any compression by default. The recommendation looks like flask-compress, but not sure if it will work with google's functions_framework flavor of flask.
https://github.com/colour-science/flask-compress

Might need to do it manually:
https://stackoverflow.com/questions/30165475/how-to-compress-minimize-size-of-json-jsonify-with-flask-in-python

@vincerubinetti
Copy link
Collaborator

vincerubinetti commented Apr 22, 2024

This seems to work, testing locally:

from flask import current_app as app
from flask_compress import Compress

Compress(app)

By default it seems to use Brotli, and testing our mock ml response on this site, Brotli compresses it the best. I'll throw it in my current PR.

GoogleCloudPlatform/functions-framework-python#75

vincerubinetti added a commit that referenced this issue Apr 24, 2024
Closes #29 

Please excuse the poor commit history and large scope on this one. To
aid in review, I'll mark important places in the code to take a look at.

- update msw api mocks to match the new post endpoints
- improve type definitions for api requests and responses, with
collocated transformation functions
- for zag components, move props to declarative "context" arguments
(that update when changed) instead of just being initialized to those
values. see
[here](https://zagjs.com/overview/programmatic-control#controlled-usage-in-reacts)
- add nicely formatted exponential component
- make dedicated "mark" component with icon and text
- refactor and fixup select component a bit
- simplify slider component marks
- rework table component. add tooltip option for header cells. add
expand control. move all controls to bottom for cleanness.
- remove use-query-params package. just use react-router built-in
useSearchParams (for now)
- add basic [load] analysis page. ability to download/upload
inputs/results, or take inputs sent to it from new analysis page and run
query for results. add tabs for each part of results. basic tables for
most tabs, then one network tab.
- network tab. uses d3-force for physics simulation, d3-zoom for view
zoom/pan, d3-drag for node dragging. tries to use react for declarative
rendering as much as possible.
- add download svg util func
- add/update custom useQuery hook that replaces tanstack react table
(simpler, more control)
- add some math util funcs
- tweak format number util func to print small numbers more nicely
- update cloud functions: add brotli compression, print full stack trace
on error, fix status codes

---------

Co-authored-by: Christopher Andrew Mancuso <chrismancuso1984@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants