This content has been marked as final. Show 5 replies
why not flush() periodically. you can use a timer to do just that.
There are a few reasons why flushing periodically is not a satisfactory solution:
1. The amount of data in the SharedObjects can be large.
2. We need to minimize the amount of writes to disk (can't say why, due to NDA).
3. If the interval is very short, the program will be slowed down by constantly writing to disk.
4. If the interval is not short, it is likely that the user will perform some state-changing action, then close the program, but their change won't be saved.
Flushing every time the data changes has problems 1, 2, and 3 and but not 4.
Perhaps you could copy 'delta' information - ie recent changes to the main sharedObject data and save it in another sharedObject , forcing a flush on that...I guess it contributes to the 100k limit, but if the changes are small relative to the stuff that doesn't change perhaps it would help - because presumably it would be faster writing to disk. You could then erase this data on the next load after checking that the main sharedObject contains all the updated values. Its probably not that great of an idea but I can't think of anything else...
There is a post here:
Note that a solution that only works with Firefox would be acceptable.