Hi everyone, I’m building a Morse Code Translator website that uses an external API for real-time text-to-Morse and Morse-to-text conversion. The platform works well initially, but during continuous typing or rapid requests, the API responses become delayed and sometimes return outdated or incomplete data. This creates inconsistent translations on the frontend and affects the overall user experience.
The application uses JavaScript Fetch API with asynchronous requests, and I suspect the issue is related to request handling, overlapping responses, or API rate limits. I’ve also noticed occasional timeout and CORS-related errors when multiple requests are triggered quickly. Since the translator updates results live while users type, managing request frequency efficiently has become challenging.
I’d appreciate suggestions on best practices for handling real-time API communication in web applications like this. Would implementing debouncing, throttling, caching, or request cancellation improve performance and stability? Any recommendations for optimizing async API handling and preventing response conflicts would be really helpful.