[nycphp-talk] the stale V in MVC web apps
John Campbell
jcampbell1 at gmail.com
Wed Mar 4 12:17:28 EST 2009
On Wed, Mar 4, 2009 at 11:53 AM, David Mintz <vtbludgeon at gmail.com> wrote:
>
>
> 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.
In many cases, you can get away with using timestamps. If you have
update_at columns, then you can compare the timestamps. In theory,
there are problems with this method (such as updates that happen
during the same second), but in practice, it works quite well.
More information about the talk
mailing list