Skip to content

Improve App Performance by Moving Polling Logic to Backend #246

@Joel-C-Johnson

Description

@Joel-C-Johnson

Issue

While testing the app in the field (especially in Hubballi), I observed noticeable performance drops compared to usage outside the local network.

After some analysis, I found that one of the key reasons could be our current frontend polling workflow.
Right now, the UI makes repeated calls (every few seconds) to the external API to check for job status. With multiple users on the same LAN (e.g., 100+ users), this creates heavy network and API load, causing slower response times.

Proposed Solution:

Move the polling and job status handling logic from the frontend to the backend.
The backend can then:

  1. Poll the external API once per job and cache/store the result.
  2. Send the final output to the frontend only when it’s ready.

This change will:

  1. Reduce unnecessary network traffic.
  2. Improve app speed and responsiveness for users.
  3. Enhance scalability and reliability.

Additional Notes:

  1. The issue was mainly observed when many users were connected on the same LAN during the workshop (~400 total, ~100 using the app).
  2. Outside the LAN, performance is normal.
  3. Implementing backend polling (or push notifications via WebSocket/SSE) should help balance load and improve overall performance.

ScreenShot

Image

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions