2015-09-09
2.0.1
Goncalo Borrega
9.0.1.18
All
.NET
Widgets
[Overview]
An implementation pattern that shows how to periodically poll, via ajax, a page that return a JSON timestamp that inform the browser whether it should automatically refresh some part of the screen
[Detail]
An implementation pattern that shows how to periodically poll, via ajax, a page that return a JSON timestamp that inform the browser whether it should automatically refresh some part of the screen.
If the returned timestamp has changed, a button in the page is clicked to refresh an area using the platform's ajax mechanism.
Demo at: http://goo.gl/byI4N
Feature List
- Configurable polling period. Can follow a lazy phase down: by configuring 1,3,5,10 the browser will check after 1 second, then after 3, then after 5 and afterwards every 10 seconds.
- The refresher polls a very lightweight page that is only responsible for returning the MAX(UpdatedOn) for a given "Group" (business identifier if required). If the timestamp has not changed, the page is not refreshed
- The extension is only required to obtain Ticks (a long) from a DateTime. The Thread.Sleep is for demo purposes only.
Main Benefits
- lightweight refresh. Only uses the "heavy" refresh when there is new data.