清除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.