1

I'm using Kendo UI Mobile Framework and have the bulk of my views handled as remote views. For example, a remote html doc view1.html instead of an inline div element #view1.

They all work fine in the browser, however I see some problems related to caching of these remote views:

  1. Reloading the home screen app after closing it doesn't force the web app contents to refresh/update (iOS Saved to home screen).
  2. Recreating the home screen web app doesn't force the contents to refresh/update, even after clearing the Safari web data (iOS Saved to home screen).

Does anyone know how to force the app to fetch new versions of these remote views on initial application load (once per session) when that is all taken care of behind the scenes in the Kendo Mobile Library?

I was looking into ApplicationCache but that seems pretty scary for my mostly dynamic, database intensive app. On top of this, I don't think my webserver (which runs off the back of a 4D database can actually serve the correct mime-type for appcache files).

Tim Penner
  • 3,551
  • 21
  • 36
btbJosh
  • 305
  • 2
  • 12
  • The only way I know to do it, is add the data-reload="true" to the view definition, which will for a reload from server every time. http://docs.telerik.com/kendo-ui/api/javascript/mobile/ui/view#configuration-reload – Robin Giltner Apr 13 '15 at 17:29
  • I suppose I should specify that I would prefer it to only do it per session. I don't mind the caching except I would want each time they use the app (especially in standalone mode on iOS) to grab the latest changes. In fact during development it's quite a pain. – btbJosh Apr 13 '15 at 18:43

1 Answers1

1

Since Kendo UI is using jQuery:

https://github.com/telerik/kendo-ui-core/blob/master/src/kendo.mobile.view.js#L660

you can probably stop the cache with the global $.ajaxSetup(), like this:

$.ajaxSetup({
  cache: false
});

Just make sure to switch it off before loading any other data you need.

Bundyo
  • 2,195
  • 13
  • 13
  • Thanks for the look. If I do this, won't I lose a lot of the benefit of this remote view SPA architecture? I'm not merely trying to disable the caching... I'm trying to ensure that when the user starts the app up, that they're getting the latest proper files. Unfortunately (I guess it's both a blessing and a curse), the remote views are only lazily loaded, so that makes it difficult to approach this problem. I think ultimately the problem lies with iOS standalone web app behavior, or what I am not doing to force it to grab the latest when there are indeed changes. – btbJosh Apr 14 '15 at 13:20