Re: Persisting ContentCache to disk between sessions

2018-10-29 Thread Erik Thomas
Hi Javier: With your suggestion, every new company onboarded will download the entire sprite. Sure it's only one image but it's 1500+ x 200px square. Our current architecture just downloads the single image that's new or changed at about 500 bytes. Using a sprite is definitely an interesting

Re: Persisting ContentCache to disk between sessions

2018-10-29 Thread Javier Guerrero García
You're welcome, but... what's the exact problem with spriting in that scenario? You could generate the sprite bitmap dynamically at any given time (just paste every known logo one below another), even with bare PHP (or needless to say with ImageMagic libraries), and then just poll for the last

Re: Persisting ContentCache to disk between sessions

2018-10-29 Thread Erik Thomas
Hi Javier: The thing is we have 52 investor groups in 26 countries on 3 continents and they each have admins entering information that is then displayed in our app. Part of that information are companies that are presenting at regular investor meetings in these different countries. These

Re: Persisting ContentCache to disk between sessions

2018-10-29 Thread Alex Harui
Volunteers are welcome to provide a patch that makes ContentCache serializable. IIRC, lots of Flash classes are not serializable, but IExternalizable allows you to define custom serialization. -Alex On 10/29/18, 10:22 AM, "Erik Thomas" wrote: Thanks everyone for your ideas.

Re: Persisting ContentCache to disk between sessions

2018-10-29 Thread Javier Guerrero García
Just my 2 cents: have you considered getting rid of everything and just use one sprite image for all the logos? https://www.w3schools.com/css/css_image_sprites.asp You minimize connections to just 1 download, that if properly compressed and if logos share a fair amount to colors, could get the

Re: Persisting ContentCache to disk between sessions

2018-10-29 Thread Erik Thomas
Thanks everyone for your ideas. Alex, I already knew how to do the serialization by encoding/decoding, and I may go down that path someday, but if FileStream would just serialize a ContentCache (seems like a common want), it would have been a quick improvement to app responsiveness. Having

Re: Persisting ContentCache to disk between sessions

2018-10-27 Thread Alex Harui
Hi Erik, I don't think you can have Flash serialize a Dictionary by passing a Dictionary to FileStream.writeObject. However, you can certainly iterate the Dictionary and save everything. And later, read it all back and repopulate the Dictionary. Personally, when writing custom serialization,

Re: Persisting ContentCache to disk between sessions

2018-10-27 Thread Greg Dove
Oops, I pressed send to early, more info this time :) I think BitmapData may not be directly serializable to amf. It is in display package, and although not directly a display object, it might be subject to same rules. Here's the type of thing someone did in the past to avoid that:

Re: Persisting ContentCache to disk between sessions

2018-10-27 Thread Greg Dove
Not an answer to the main question, but a couple of thoughts... I think BitmapData may not be directly serializable to amf. It is in display package, and although not directly a display object, it might be subject to same rules. Here's the type of thing someone did in the past to avoid that: Also

Re: Persisting ContentCache to disk between sessions

2018-10-27 Thread Erik Thomas
Hi Alex: The icons and logos are loaded from a server on startup, and then kept up to date via a 20 second polling pattern where the app checks if anything has changed on the server. We timestamp all images and when one does change we get latest and update the image in the app. The way a

Re: Persisting ContentCache to disk between sessions

2018-10-26 Thread Alex Harui
Erik, How do the icons and logos get into the cache in the first place? If they don't change, is there any reason not to embed them in the application? -Alex On 10/26/18, 3:36 PM, "Erik J. Thomas" wrote: Hey all: Have any of you come across an example of persisting a

Persisting ContentCache to disk between sessions

2018-10-26 Thread Erik J. Thomas
Hey all: Have any of you come across an example of persisting a ContentCache to disk and reading it back on app launch? We have lots of icons and logos for hundreds of companies and they don't change between sessions. Like this (doesn't work though). ImageCache is a subclass of ContentCache