Shared resources / polling / rjs


In my web application, a users browser is divided into more than one
panel. Each panel is filled with html from an ajax response based on
what the user would like to view. Perhaps the details of a category
and it’s associated products in one panel and a list of customer
orders with the products of each order in another panel. Two panels
might be the same. Two users may be viewing the same panel.

The content of a panel may be a form to modify the server database
records. This may affect the data in the other panels. Several users
may be viewing or modifying the same data. The data may become stale
in various panels for various users.

I would like to keep the displays fresh. In a single server poll, the
client can ask for fresh displays for all current panels. Doing the
polling often is fine; however the fresh html response for each panel
may consist of much html and some of the panels may not be stale. How
can I send fresh html only for the panels that need updating? I have
been struggling with ideas to keep track on the server of which views
have become stale because a particular view may depend on many model

For example, a category has_many products which acts_as_list
:scope=>:category. If a client is viewing a category and one of the
product names changes or the order of the list changes or an product
is deleted then the category view needs updating. This seems to get
very complicated and I would like to write an easily
maintainable/expandable Rails app that doesn’t turn into a nightmare.

Any ideas?


A bump with great hope. Any ideas?