1

Let's say my front-end makes a ton of AJAX calls to the ruby backend for JSON objects.

This is open ended, but from your experiences, which is the better option? I'm concerned with 1. performance, and 2. style

Option 1: Make one AJAX request to backend that returns a lengthy JSON string

Option 2: Break down the request into several AJAX requests that each returns a shorter JSON string.

Or an Option 3? I'll take into consideration other alternatives.

Thanks!

hackstar15
  • 1,259
  • 1
  • 10
  • 14

1 Answers1

0

I think if you are making frequent ajax request than you can try web sockets as it is very widely used for such applications these days. Here is a link that makes a very good comparison between different technologies used for such requirements: In what situations would AJAX long/short polling be preferred over HTML5 WebSockets?

Community
  • 1
  • 1