开发者

How can my Flex application know when data is stale?

开发者 https://www.devze.com 2023-01-29 02:34 出处:网络
I have a 10开发者_开发知识库0% Flex based enterprise web application with a Java/BlazeDS backend.In order to create a more snappy user experience I\'d like to load a bunch of data into the client righ

I have a 10开发者_开发知识库0% Flex based enterprise web application with a Java/BlazeDS backend. In order to create a more snappy user experience I'd like to load a bunch of data into the client right after logging in and hold it the entire session.

This would include items such as user preferences, application skins, application layouts, etc. Things that are infrequently updated on the server.

My question is, in case they are updated, what's a good approach for refreshing the client side data...and knowing when to refresh? I should say that I have no interest in Adobe LCDS!


To update data cached in the client, when that data changes on the server, you'll need to use a server side software that supports server push and will tell the client that an update is needed.

LiveCycle is one server side software that supports this. I suspect you already knew that, since you call it out in your question.

GraniteDS is another, and since it is FOSS it may be more to your liking.

I suspect WebORB also supports push functionality, but don't hold me to that.

If you don't want to do anything server side; you could set up a call from the client to the server on some timer.


Well by nature Flex is pretty much one-way and you can only get data into Flex by using an HTTPRequest - you can't just send data to a Flex client (at least not using Apache). Your best bet is to store a timestamp of preference data locally in the Flex app and use an httprequest to look up if the timestamp locally still matches the timestamp of the data in your backend app at a regular interval (ie every five minutes).

0

精彩评论

暂无评论...
验证码 换一张
取 消