Wednesday 15 February 2012

javascript - localStorage store large size data -


I want to use local storage to store large amounts of data (such as 800 GB), and I , I changed my local storage size and also the cache size. So size is not a problem. However, I write some jquery like the following:

  $ ("a [href]"). Click on each (function () {$ (this). (Function (event) {localStorage. Test + = "somenewinformation"; ...   

If already large amounts of data 400GB, so the storage information phase will be very slow.Link, local waiting will wait for me jquery to finish new information, or it will just go to the next page and local storage.All of the information in the test will be lost or local storage. Test will be old value now? I do not It is to understand whether it will generate a new thread for this storage in the background or not and whether it will affect the closure of the browser in between.

Messy Details and Thanks Thanks in advance! < /p>

You can not! The normal limit is 5 MB.

Some browsers like Opera Allow you to adjust the size, but it is completely dependent on the browser And this is the one action initiated by the user, not a programmable.

And even if you can do this, remember that local storage Only strings can be stored so that anything needs to be done before string. Together with this one key / value storage array, you will eventually go into very poor performance.

If you need large storage capacity, then see it instead of file API, it is created to work with big files (Blobs) and you can store anything in the form of a blob .

800 GB is a larger size and file API can work faster as a file system only (best, shut down as file system API ( Note: 4/2014 More about:

Tutorial:

Blob:

Li> < Strong> indexed database API aka indexed DB (recommended)

  • Web SQL (deprecated but still supported in browsers like Safari)

    In addition to this they have been initially limited by the browser

    See more information about this API here:
    It is possible to make a big quote request that the user is asked to accept.

  • No comments:

    Post a Comment