Front End-"learning experience"-improved mobile performance by 4

Source: Internet
Author: User

Today I've been tinkering with a mix of apps, and it's really exciting to see this hybrid project in the node community. Unfortunately, I don't know why compass can't be successfully installed on a Mac, whether I change the gem source, or if I install compass-related dependencies in advance, it can't be installed. Hope to have the great god see this article to help guide under.

Today summarizes the localstorage of networked storage.

Unlike browser caching, Localstorage provides a method of full manual control. You decide what to put and when to take it out. When it expires. Google gives the suggestion that contains let us use localstorage cache js and CSS.

Localstorage only 5 m, so we need to determine whether it is full, the way to judge is to Localstorage as a normal JS object, Json.stringify (localstorage) Returns a JSON-formatted localstorage. Then we can use a trick, unescape (encodeURIComponent ("string"). Lengh), which gives the size of the string (in bytes).

5m=1024*10224*5 bytes, the free space is 1024*1024*5-unescape (encodeURIComponent (json.stringify (Localstorage))). length

Of course we can use try catch when we plug in the data, which is often used in Java background development, and here is also possible.

Front End-"learning experience"-improved mobile performance by 4

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.