This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.

Sunday, October 02, 2005

Permanent Client-Side Storage for AJAX Applications, Part II

Recently on AjaxDeveloper a blog post was entered about the new permanent client-side storage API I've put together:

"On Coding in Paradise today, there's a quick new post from Brad about his work to make a permenant client-side storage system for Ajax-enabled applications.

...

Betwen this and the bookmarking/history framework that he's worked up previously, there's some very cool things coming out of his area - some things that could change the way a lot of the Ajax applications out there work..."

I posted the following to his blog, detailing more about the API:

Thanks for the comment and post. On Friday I stored over 10 megabytes into the client side storage API; it was fast and reliable. After a user gives permission, a given web site can store as much information as a user gives permission. The API is straightforward; it looks like a hash table, with simple put and get methods. Developers can put entire JavaScript objects into permanent storage; under the covers I serialize the objects into strings and store them, so developers can work at a higher level. For sheer, large scale data, however, like XML files that are multimegabyte, you can also store simple strings, which are faster.

I'll be posting the code next week; I have a bit more fit and finish work to do, including more QA, detecting and installing Flash if its not there, the Show Settings button has a bug that makes it not disappear, and so on, but you can get an early peek at the code over at codinginparadise.org/projects/storage/version0.0.1. Check out the test file at codinginparadise.org/projects/storage/version0.0.1/test.html; it is a bit cryptic, more focused on helping me test things, but basicly it allows me to test various things, like storing large amounts of data and ensuring that the Flash popup that appears after users store more than 100K is centered in the middle of the screen even if the user has scrolled down (surprisingly, this was one of the hardest things to get working).

The segments field in the test file controls the amount of data that is saved; set it to a large number to save multimegabyte files. The testing script generates meaningless lorem ipsum text to save. You will see a Flash popup appear in the middle of the page asking the user permission to save data beyond 100K. Press Approve or Deny. The AJAX application programmer gets callbacks telling them if their put() request was approved.

Only Firefox and Internet Explorer are supported at this time. I still need to do more extensive testing so tell me if things break. The code is also under a BSD license.

I'm looking for a good name for the framework if anyone has any ideas.

Comments:
Hi brad, this is an excelent Idea.
I tying to run it on an Pocket PC, but i doesnt works. The Storage class is not defined, there is some js incompatibility but the Pocket IE does not give me any information ...

Any Idea or Tip, to get it work on Pocket IE?

thanks a lot in adavanced.

Best regards

ps: i alredy install the flash player 7 for pocket pc and works ok.
 
Post a Comment



Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]