I’m developing a small web-based calculator tool (a financial or estimation calculator) that performs real-time calculations using JavaScript on the frontend. However, as the logic has grown, I’ve started offloading some operations to a lightweight backend API (Node.js + Express).
The challenge I’m facing:
-
Sometimes, calculations lag when multiple users hit the tool simultaneously.
-
API responses are fast locally but become slower when deployed online.
-
I’ve tried implementing local caching using localStorage on the frontend and simple in-memory caching with Node.js on the backend, but I’m not sure if this is the best approach.
-
I also tested asynchronous calculation batching using Promises to reduce response time, but it didn’t help much under concurrent load.
I’d love some advice on:
-
What’s the most efficient way to handle repeated calculations — browser-side caching, service workers, or something like Redis?
-
Should I shift more logic back to the frontend and reduce server hits?
-
Any best practices for keeping such tools lightweight while maintaining accuracy and responsiveness?
I was expecting smoother performance and faster responses when multiple users accessed the calculator at the same time, but the lag still appears randomly — especially when API calls stack up.