Handling iOS webview update cache local CSS, JS after WebView cache cannot update the issue

Source: Internet
Author: User

The project needs to use the app local CSS, JS, and can be issued according to the service automatically update local CSS, JS. Test found that as long as the updated CSS or JS and update before the path is consistent, WebView loaded or updated before the CSS, JS. The suspicion is that WebView itself caches css, JS.

Using many native methods such as:

[[Nsurlcache Sharedurlcache] removeallcachedresponses];
[[Nsurlcache Sharedurlcache] setdiskcapacity:0];
[[Nsurlcache Sharedurlcache] setmemorycapacity:0];

Can not be solved.

Consider that WebView and browsers are similar by adding timestamps after loading local CSS, JS paths: file://xxxxx/abc.css?12344321 Each time the timestamp of the load is different so that the latest css! is used

Handling iOS webview update cache local CSS, JS after WebView cache cannot update the issue

Related Article

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.