[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
Nope. I mean clean-side database storage - http://webkit.org/blog/126/ webkit-does-html5-client-side-database-storage/ Wow that's cool, I don't use Safari myself so I wasn't aware of that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
I use small (40 lines of code) storage class, that uses cookies or localStorage. I wasn't able to use cookies for two reasons a) Cookies aren't ment for data storing but for token storing, so they provide EXTREMELY limited space. It's hard to push hundreds of kilobytes into cookies. b) My intention was to use this module with a website with very heavy load - millions of pageviews per day. Storing data in a cookie means that this data is being passed around between the browser and the server with every request made to the server (while loading images, static files, etc.). Every kilobyte of data for one million requests makes about 1 GB of extra traffic. It's not much compared to the overall traffic, but it's stil 1 GB per day. And I would like to store not 1 kB but hundreds of kilobytes data. Without the cookies, data is pulled from the server only when there's actual need, not with every request. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
May I ask you about localStorage? I want to update some property, but no space left on device and FireFox throws error NS_ERROR_FILE_NO_DEVICE_SPACE, so localStorage[property] stays unchanged. try{ localStorage[property] = value; //throws NS_ERROR_FILE_NO_DEVICE_SPACE }catch(e){ localStorage.removeItem(property);// also throws NS_ERROR_FILE_NO_DEVICE_SPACE } How to update property or remove it at all? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
On a side-note, I think local storage will soon become as important to client-side code as AJAX, and (at least at this stage) it also seems to suffer from browser incompatibilities. Never say never. ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
On Sep 30, 10:05 am, andris andris.rein...@gmail.com wrote: Nope. I mean clean-side database storage - http://webkit.org/blog/126/ webkit-does-html5-client-side-database-storage/ Wow that's cool, I don't use Safari myself so I wasn't aware of that. I tried to implement the openDatabase support (I dind't find any documentation though :S) but wasn't very successful. openDatabase queries seem to be asynchronous (I execute the query but the results come a little bit later) and that doesn't fit with with my caching system, which provides the data of the cached items immediatelly after the initialization of the module. With openDatabase the module is still waiting for the results from the database while the initialization is already done and program flow goes on. I'd probably need to redesign the module in order to get it working with the openDatabase support. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
On Sep 30, 12:19 pm, Joran Greef jorangr...@gmail.com wrote: On a side-note, I think local storage will soon become as important to client-side code as AJAX, and (at least at this stage) it also seems to suffer from browser incompatibilities. Never say never. ;) I couldn't agree more. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
On Sep 30, 5:15 am, Joran Greef jorangr...@gmail.com wrote: [..] In other words, setting about 1000 objects to local storage takes about 3.3 milliseconds in Safari and 2 seconds(!) in Firefox. localStorage is not the most stable component in Firefox, but it's getting there :) I recently filed a ticket related to clearing (https:// bugzilla.mozilla.org/show_bug.cgi?id=510234). There's also a minor discrepancy with `key` (https://bugzilla.mozilla.org/show_bug.cgi? id=509241), and few others that you can find on a bugtracker. Please, file a bug. [...] -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
Thanks for the links will do. Hope it's also helpful to the discussion at hand. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
On Tue, Sep 29, 2009 at 7:12 AM, andris andris.rein...@gmail.com wrote: Hi, I've implemented a simple library on the top of DOM storage and IE userData to act as a browser side caching solution called DOMCached (www.domcached.com). The library acts like a kind of javascript memcached caching solution - a script can store objects to the cache and retrieve it later on another pageview. For example if the user is already made an Ajax request and the data is stored to the DOMCache then there is no need to do this request to the server again. Or if you try to fill out a form and your browser crashes - if the data was stored to the cache by the script then nothing is lost when you re-open the form. And so on, the possibilities are endless. Anyhow - I was wondering if similar functionality (or DOMCached itself) could be added to the Prototype library? Best regards, Andris Reinman +1 As a user of Prototype, I'd like to see something like this added. Clean, simple and useful. Mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
On Sep 29, 10:12 am, andris andris.rein...@gmail.com wrote: Hi, I've implemented a simple library on the top of DOM storage and IE userData to act as a browser side caching solution called DOMCached (www.domcached.com). The library acts like a kind of javascript memcached caching solution - a script can store objects to the cache and retrieve it later on another pageview. For example if the user is already made an Ajax request and the data is stored to the DOMCache then there is no need to do this request to the server again. Or if you try to fill out a form and your browser crashes - if the data was stored to the cache by the script then nothing is lost when you re-open the form. And so on, the possibilities are endless. I've done something similar (although not publicly available yet) :) Why don't you use database abstraction when available? It would fill in those Safari 3 and Chrome gaps. Anyhow - I was wondering if similar functionality (or DOMCached itself) could be added to the Prototype library? I can't speak for everyone in the core, but most definitely not. This is clearly more suited for a standalone module. On a side note, I haven't noticed any unit tests; only functional ones on the front page. -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
Thank you for the replies! Why don't you use database abstraction when available? It would fill in those Safari 3 and Chrome gaps. Do you mean database abstraction as a server side database? My point was only to use browser-side for the caching. On a side note, I haven't noticed any unit tests; only functional ones on the front page. Sorry for that, the idea struck me yesterday and I immediately tried to implement it (along with the domain registration and so on:) ), so there hasn't been much time to come up with the correct tests. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
On Tue, Sep 29, 2009 at 1:37 PM, kangax kan...@gmail.com wrote: I can't speak for everyone in the core, but most definitely not. This is clearly more suited for a standalone module. Actually, you changed my [user] mind. Module makes more sense. Core libs shouldn't get bloated. (but this is good to know about, thanks!) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
On Sep 29, 5:48 pm, andris andris.rein...@gmail.com wrote: Thank you for the replies! Why don't you use database abstraction when available? It would fill in those Safari 3 and Chrome gaps. Do you mean database abstraction as a server side database? My point was only to use browser-side for the caching. Nope. I mean clean-side database storage - http://webkit.org/blog/126/ webkit-does-html5-client-side-database-storage/ [...] -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
I use small (40 lines of code) storage class, that uses cookies or localStorage. IMHO, userData and databases not so usefull: IE userData behavior relies on DOM. database works in webkit, which supports localStorage. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
On Sep 30, 12:01 am, Yaffle vic99...@yandex.ru wrote: [...] database works in webkit, which supports localStorage. Not in Safari 3 and not in any version of Chrome as of now (although, Chrome is working on `localStorage` at the moment - http://code.google.com/p/chromium/issues/detail?id=4360). Both - Safari 3 and Chrome - have database storage, though. -- kangax --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---
[Prototype-core] Re: Suggestion: DOM storage methods to Prototype
Yes that's is, but Safari and Chrome isn't popular browsers.(depends on site audience) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype: Core group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~--~~~~--~~--~--~---