August 20 = 441-445

Source: Internet
Author: User

16.4 storage of structured data

As we can see above, when using storage to save the key-value pair, the key and value can only be strings, which is sufficient for simple data. However, if you need to save more complex data,

For example, you can save the data similar to the table record, so you can combine the JSON knowledge described above.

To store structured data, follow these steps:

Encapsulate structured data into JSON objects.

Convert the JSON object to a string and save it.

To read data, follow these steps.

Reads a string in JSON format.

Converts a string in JSON format to a JSON object.

Extract data using JSON object attributes.

 

16.2 offline applications

Client storage usually needs to be used together with offline applications. The most common application methods can be divided:

When a user is online and can connect to the server, the data is directly submitted to the server for direct interaction with the server.

When a user is offline and cannot connect to the server, the user browses and operates offline applications, so that the user can use the web application even if the user does not have a network, when operating offline applications, all data is stored locally.

When the user accesses the network again, the Web application control submits the data stored in the local storage to the remote server.

Offline applications can cache some or all pages in the browser, so that users can operate on this offline application even if they are not connected to the Internet.

 

16.2.1 differences between offline applications and browser cache

Before introducing offline applications, some may confuse offline applications with browser cache because browser cache can also cache webpages. But in fact, there are essential differences between offline applications and browser cache.

Different services: Offline Application Control caches the entire web application. Offline applications provide an offline website service function, while browser cache simply caches webpages.

Different reliability: offline applications can precisely control the resources that the browser needs to cache, which is very reliable. However, browser caching relies entirely on browser behavior and has a certain degree of reliability.

Different controllability: offline applications can accurately control the resources cached and refresh the cache. However, browser cache is completely dependent on browser behavior, and programs cannot control cache behavior.

August 20 = 441-445

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.