NYCPHP Meetup

NYPHP.org

[nycphp-talk] the stale V in MVC web apps

David Mintz vtbludgeon at gmail.com
Wed Mar 4 11:53:16 EST 2009


On Wed, Mar 4, 2009 at 11:34 AM, Brent Baisley <brenttech at gmail.com> wrote:

> Use AJAX instead to refresh just the part of the page that needs
> refreshing. If it's a fair chunk of information, you set a "version"
> on the server so the AJAX call just checks the current version vs it's
> version. If it's different, then you refresh the content. If it's not
> different, no need to refresh anything and you only did a light weight
> server call, so you could do it every 15 seconds.


Forgive me, I don't quite understand *how* you would set the version
information on the server in order to compare.

The Prototype library has an Ajax periodical updater (
http://prototypejs.org/api/ajax/periodicalUpdater) that takes a "decay"
option which "controls the rate at which the request interval grows when the
response is unchanged." The longer the server data stays unchanged, the less
frequently it fetches. Clever and elegant. Something like that would do
nicely, but I have other reasons for tending to prefer JQuery, which doesn't
seem to have a counterpart.

<snip/>

-- 
David Mintz
http://davidmintz.org/

The subtle source is clear and bright
The tributary streams flow through the darkness
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090304/2547e935/attachment.html>


More information about the talk mailing list