清除Cordova应用程序中的缓存 [英] Clear cache in Cordova app

查看:1111
本文介绍了清除Cordova应用程序中的缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在更新我的Android应用的www文件夹(使用Cordova 3.6.3)时,该应用显示了我的www的旧缓存版本.

When updating the www-folder of my Android app (using Cordova 3.6.3), the app shows an old cached-version of my www.

如果我清除了应用程序数据(从Android-> Settings-> Apps)并运行了该应用程序,则会显示www的新更新版本.发布新版本的应用程序时,这是一个大问题.

If I clear app-data (from Android->Settings->Apps) and run the app, the new updated version of www is shown. This is a big problem when publishing new versions of the app.

如何在更新应用程序时(或仅在每次启动应用程序时)强制应用程序清除缓存?

How can I force the app to clear the cache when the app is updated (or just every time the app starts)?

推荐答案

我不太使用Sencha Architect,所以这可能不是解决方案,但是当我发生类似的事情时,我通常只是...

I don't use Sencha Architect much so this might not be a solution, but when I've had similar things happen I usually just...

cd to/MyApp
cd cordova && cordova platforms rm android
# then
cordova platforms add android
# or 
cd .. && sencha app build native

...然后让Sencha CMD负责重建cordova应用程序.如果您在android目录中进行了任何更改,它们将被删除.

...and let Sencha CMD take care of rebuilding the cordova app. Tho if you have made any changes within the android directory they will be removed.

如果要在cordova/www/目录中进行更改,则这些更改将重新出现.

If you are making the changes within the cordova/www/ directory then those will reappear.

这篇关于清除Cordova应用程序中的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆