0

In this section:

http://en.wikipedia.org/wiki/Comet_%28programming%29#XMLHttpRequest

it mentions the idea of a multipart reply from the server to the browser. This is a very interesting concept by itself (separate from Comet).

I have pages that are very long with thousands of database hits. Each hit is rendered one per line in a table. For the whole complete round trip it takes about 30 seconds. A fairly significant amount of this time is just rendering the items into json.

One idea I'm trying to map out is to respond with the first page full of items and then fill in the rest of the items in subsequent updates. If I go back to the server for the updates, I'm adding extra load on the server (or I have to figure out some way to cache the results probably using Dali)

I've bumped into various "grid" solutions like jqGrid. I may explore that more.

But if the server could respond back with a multipart reply that the browser would then read the same as a sequence of replies, that would save a lot of work and also be very handy for many situations.

Surfing the web, I don't see many hits on this idea. I'm wondering if it has died or if it is still available -- perhaps just not being used much.

pedz
  • 2,271
  • 1
  • 17
  • 20

1 Answers1

0

I don't know if Rails can handle that yet, but I would use evented machine or node.js for this task.

Oscar Del Ben
  • 4,485
  • 1
  • 27
  • 41
  • Seems sort of like a silly suggestion. You want me to change everything just to get one feature? – pedz Jun 15 '12 at 02:50
  • No, but it's not uncommon to have a section of your app using different technologies, and you can certainly use evented machine from Rails. Example: https://github.com/igrigorik/async-rails or you could checkout this screencast http://railscasts.com/episodes/266-http-streaming – Oscar Del Ben Jun 15 '12 at 03:58