Sign in to follow this  
  • entries
    292
  • comments
    557
  • views
    153567

Untitled

Sign in to follow this  
TANSTAAFL

212 views

The Goal: to use javascript for everything.

The Project: A javascript version of Space Trader. (mainly to determine feasibility of javascript for large projects)

The Snag: Data persistence between page visits.

Ideally, this should be client side, so that no server side login system needs to be developed.

the way it works on the palm is to save a big blob of data, and I have modeled a similar blob of data in the javascript version.

in order to serialize this data as a single blob, I am using JSON Strings. Everything was going along swimmingly. I can serialize objects to strings in a compact manner and vice versa.

the way i chose to serialize the data client side was through cookies, where I have run into my first disappointing problem.

cookies can only be 4k.

my data (blank data with all zeros and empty strings) is 24k, and is likely to be twice this size or more when it holds "real" data.

and there is really no way to get it less than 4k, period.

so, i figured, i'll split it up into strings that aren't too long, and store it that way. no problem.

but i have since done a little more digging. I have found out that only 300 cookies may be stored on a machine at a time, and only 20 cookies per domain, so , at best, I can have about 80k worth of data that I can serialize to cookies, and these cookies are in great danger of clobbering or getting clobbered by other cookies.

it's beginning to look like a login system. time will tell.
Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now