[flexcoders] Re: caching in Flex
Just catching up on flexcoders and came across this thread. If for example, you don't have access to implement cache control on your server tier, or you want more sophisticated caching requirements, you might want to check out this client-side caching implementation i wrote: http://booleanbetrayal.com/2007/06/08/cachemoney-httpservices/ basically involves extending HTTPService and ResultEvent to implement a cache manager, without mucking up any service call / result handler logic. - Brent --- In flexcoders@yahoogroups.com, seemaherein [EMAIL PROTECTED] wrote: Thanks Paul You are really great in response. I would like to be in touch with you in case i need any advice Thanks again Seema --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote: One last thing. If you write anything away, the data in the cache will become stale unless it's updated, or the cached data is removed. If you have a client side cache and don't handle this, you could have two different clients having a different view of the data (one a stale cached version, the other an up to date version). If you have data in a server side cache that is stale, all of the clients will be showing out of date information.. Good luck. Paul - Original Message - From: seemaherein seemaherein@ To: flexcoders@yahoogroups.com Sent: Wednesday, September 19, 2007 2:25 PM Subject: [flexcoders] Re: caching in Flex sure, i'll let you know. I am a starter with all this. and really thankful to you for your valuable suggestions --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote: Remember to have a way to turn the cache on and off - then you can measure how effective it is. Naturally, it takes time to fill a cache with enough results before it becomes effective. A server side cache is effectively saving you the time involved in a database query (for all clients), but not saving you any transfer time for the results ( which may be significant for large amounts of data). I don't think that you ever said what large was! A client-side cache would save you db access time and transfer time, but only for that specific client. Let us know how good the improvement is! Paul - Original Message - From: seemaherein seemaherein@ To: flexcoders@yahoogroups.com Sent: Tuesday, September 18, 2007 8:11 AM Subject: [flexcoders] Re: caching in Flex Thanks Paul Tom I'm planning to implement server side cache. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders% 40yahoogroups.com Yahoo! Groups Links
[flexcoders] Re: caching in Flex
Thanks Paul You are really great in response. I would like to be in touch with you in case i need any advice Thanks again Seema --- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote: One last thing. If you write anything away, the data in the cache will become stale unless it's updated, or the cached data is removed. If you have a client side cache and don't handle this, you could have two different clients having a different view of the data (one a stale cached version, the other an up to date version). If you have data in a server side cache that is stale, all of the clients will be showing out of date information.. Good luck. Paul - Original Message - From: seemaherein [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, September 19, 2007 2:25 PM Subject: [flexcoders] Re: caching in Flex sure, i'll let you know. I am a starter with all this. and really thankful to you for your valuable suggestions --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote: Remember to have a way to turn the cache on and off - then you can measure how effective it is. Naturally, it takes time to fill a cache with enough results before it becomes effective. A server side cache is effectively saving you the time involved in a database query (for all clients), but not saving you any transfer time for the results ( which may be significant for large amounts of data). I don't think that you ever said what large was! A client-side cache would save you db access time and transfer time, but only for that specific client. Let us know how good the improvement is! Paul - Original Message - From: seemaherein seemaherein@ To: flexcoders@yahoogroups.com Sent: Tuesday, September 18, 2007 8:11 AM Subject: [flexcoders] Re: caching in Flex Thanks Paul Tom I'm planning to implement server side cache. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders% 40yahoogroups.com Yahoo! Groups Links
[flexcoders] Re: caching in Flex
sure, i'll let you know. I am a starter with all this. and really thankful to you for your valuable suggestions --- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote: Remember to have a way to turn the cache on and off - then you can measure how effective it is. Naturally, it takes time to fill a cache with enough results before it becomes effective. A server side cache is effectively saving you the time involved in a database query (for all clients), but not saving you any transfer time for the results ( which may be significant for large amounts of data). I don't think that you ever said what large was! A client-side cache would save you db access time and transfer time, but only for that specific client. Let us know how good the improvement is! Paul - Original Message - From: seemaherein [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, September 18, 2007 8:11 AM Subject: [flexcoders] Re: caching in Flex Thanks Paul Tom I'm planning to implement server side cache.
Re: [flexcoders] Re: caching in Flex
One last thing. If you write anything away, the data in the cache will become stale unless it's updated, or the cached data is removed. If you have a client side cache and don't handle this, you could have two different clients having a different view of the data (one a stale cached version, the other an up to date version). If you have data in a server side cache that is stale, all of the clients will be showing out of date information.. Good luck. Paul - Original Message - From: seemaherein [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Wednesday, September 19, 2007 2:25 PM Subject: [flexcoders] Re: caching in Flex sure, i'll let you know. I am a starter with all this. and really thankful to you for your valuable suggestions --- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote: Remember to have a way to turn the cache on and off - then you can measure how effective it is. Naturally, it takes time to fill a cache with enough results before it becomes effective. A server side cache is effectively saving you the time involved in a database query (for all clients), but not saving you any transfer time for the results ( which may be significant for large amounts of data). I don't think that you ever said what large was! A client-side cache would save you db access time and transfer time, but only for that specific client. Let us know how good the improvement is! Paul - Original Message - From: seemaherein [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, September 18, 2007 8:11 AM Subject: [flexcoders] Re: caching in Flex Thanks Paul Tom I'm planning to implement server side cache. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links
[flexcoders] Re: caching in Flex
Thanks Paul Tom I'm planning to implement server side cache. --- In flexcoders@yahoogroups.com, Paul Andrews [EMAIL PROTECTED] wrote: - Original Message - From: seemaherein [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Friday, September 14, 2007 10:33 AM Subject: [flexcoders] caching in Flex hi, I have a flex application which is making http service calls to java code. Which is executing queries on oracle database and fetching large no of results. Investigate adding server code to filter/amalagamete those results to reduce the volume. If you are displaying data for a week, just get a weeks worth of data, etc. If you can consider whether you need all the data in one chunk. If you can split the data and use the parts independently, you can at least give the end user something to look at while data is loading. Store the returned data in a local data structure/cache. It doesn't have to be a local shared object. Consider implementing a cache on the server side. That will potentially reduce DB queries too. To invalidate a local client-side Flex cache, consider using a push-technology so that the server can inform the client that data is invalid and should be removed from the local cache. Withouth a push-technology, consider invalidating the cache on the basis of a stale data timestamp. Depending on how critical this is, have a client side cache in flex and a server side cache. The server side cache will minimise DB queries for multiple clients, the client side cache will minimise transfer for a particular client. that is very time consuming. This application is just a reporting tool so it doesn't make any updations to the database but only reads data. My question is that how can i implement caching in Flex so that for same kind of query it doesn't go to database and all. A cache is basically a data structure to hold data ready for repeated use, so it's structure can be anything that you want. In the past I've made them by using a combination of three things: 1) a signature that represents the cache query (for example a combined string for a date and department number that represents a unique key for the data set being requested), 2) a timestamp for the query (so it can be purged when stale), 3) an object to hold the query dataset. If the cache is interrogated with a signature not seen before, the query continues on to the server or database. If the signature is found, the dataset object is returned from the cache. Tom has already given the simplest form of cache! Paul Please help. thanks in advance.
Re: [flexcoders] Re: caching in Flex
Remember to have a way to turn the cache on and off - then you can measure how effective it is. Naturally, it takes time to fill a cache with enough results before it becomes effective. A server side cache is effectively saving you the time involved in a database query (for all clients), but not saving you any transfer time for the results ( which may be significant for large amounts of data). I don't think that you ever said what large was! A client-side cache would save you db access time and transfer time, but only for that specific client. Let us know how good the improvement is! Paul - Original Message - From: seemaherein [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Tuesday, September 18, 2007 8:11 AM Subject: [flexcoders] Re: caching in Flex Thanks Paul Tom I'm planning to implement server side cache.
[flexcoders] Re: caching in Flex
that is also an issue - identifying stale data. I guess i should implement server side caching. I'll give that a try. Thanks everybody for your responses. --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: You can store results in local SharedObject, but how will you know if the data is stale? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of seemaherein Sent: Friday, September 14, 2007 2:33 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] caching in Flex hi, I have a flex application which is making http service calls to java code. Which is executing queries on oracle database and fetching large no of results. that is very time consuming. This application is just a reporting tool so it doesn't make any updations to the database but only reads data. My question is that how can i implement caching in Flex so that for same kind of query it doesn't go to database and all. Please help. thanks in advance.