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

slim world map representation and add gzip middleware #369

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

timcowlishaw
Copy link
Contributor

Only send the fields we need to render the world map. We also add Rack::Deflate middleware to gzip all json responses.

Partially addresses: fablabbcn/smartcitizen-web#451 (comment)

Overall, this cuts the weight of the world map from ~4.5MB to ~250k, and the response time down to approx 1.5 sec.

The speed up from caching the /world_map endpoint is now negligible, so we might think about removing that once we've verified that this all works correctly.

@timcowlishaw
Copy link
Contributor Author

Deployed to staging on branch staging-2024-10-10

@oscgonfer
Copy link
Contributor

oscgonfer commented Oct 14, 2024

Hi @timcowlishaw I was just testing this, and I think we can remove the owner from the world_map response.

@timcowlishaw timcowlishaw merged commit a12bcc6 into master Oct 14, 2024
2 checks passed
@timcowlishaw timcowlishaw deleted the slim-world-map-response branch October 14, 2024 10:18
Copy link

sentry-io bot commented Oct 14, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ActionView::Template::Error: wrong number of arguments (given 1, expected 0) V0::DevicesController#world_map View Issue
  • ‼️ **Rack::Timeout::RequestTimeoutException: Request ran for longer than 20000ms ** V0::DevicesController#show View Issue
  • ‼️ **Rack::Timeout::RequestTimeoutException: Request ran for longer than 20000ms ** V0::UsersController#index View Issue

Did you find this useful? React with a 👍 or 👎

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 this pull request may close these issues.

2 participants