I have been working on offline application of sapui5. I have gone through these two links.
http://scn.sap.com/docs/DOC-45756
http://help.sap.com/saphelp_nw74/helpdata/en/91/f080966f4d1014b6dd926db0e91070/content.htm
But I am still unable to implement cache handling in my application.
My requirement
Even if network is not there the application should load from browser cache.
view , controller and sapui5 library should be cache.
Try to use cache control feature in sapui5 which will store files in caches in browser. You have to include cache control in neo app.json file
Related
Currently using Wakanda 1.1.3 with a mostly Angular4 on client side, yet, a few prototype pages persist from
our initial project. Provided we make the necessary file structure, module, login and syntax changes for v2,
will Wakanda v2.4+ serve our older prototype pages?
If so, is there anything special or unique that we need to do to get a prototype page to load?
You can save the WAF files (JS & CSS) generated by the v1.1.3 runtime for each prototype page.
Open your prototype page in a browser.
Open the browser console.
Save both waf~css and waf~js files.
Hard link these files in your prototype page.
This should be enough to run on Wakanda v.2.6.0
I host my app on the browser and I using a wrapper to load it on the mobile phone. I have huge problem with cashing data, anytime I make a change in the code, or different user log in I have to delete the app and install it again so I can see my changes. What should be done so I prevent caching .
I tried things that I read in this site about it but still I have the same issue.
I also save some data in the local storage browser
I know that MvvmCross allows us to download and cache images into our applications by using both DownloadCache and File plugins. But is it possible to setup the default cache configuration to use a custom cache key filter?
Reference:
Sometime, you may not want to use the image URL as cache key because
part of the URL is dynamic (i.e.: for access control purpose)
SDWebImage - Using cache key filter
Did some of you already developed this feature?
I am new to MvvmCross and I couldn't find the open source implementation for the IMvxImageHelper<Bitmap> interface. As my application always download images using a temporary signature at the end of each image url, the cache mechanism never works.
No, the DownloadCache plugin in MvvmCross doesn't support that CacheKey filter - it caches on url.
The existing source is in Plugins/Cirrious/DownloadCache in http://github.com/slodge/mvvmcross
Alternatively IMvxImageHelper<UIImage> is a very simple interface so you could create your own custom implementation - especially as it sounds like you have a clear understanding of what you need.
I am currently looking at implementing YUI 3.5 pr1 (and then the final version when released) in a fairly large application.
The backend is built with PHP and MySQL using a MVC structure with a front controller pattern. By it self, the server can process URLs (http://mysite.com/module/submodule/option) etc and return a fully rendered page.
I would like to implement the App Framework in YUI across the whole application so that javascript-enabled browser will effectively have something like a 1-page app with history management avaliable.
I am currently looking at the app framework docs on the staging site. Unfortunately, the docs aren't complete (in particular sections on routing coordination with server and progressively enhanced apps).
In any case, if a user visits http://mysite.com/modules/submodule/option with an HTML4 browser (all versions of IE), and he has javascript enabled, he would need to be redirected to http://mysite.com/#/modules/submodule/option.
Is this something that's built into the App Framework? I would prefer to utilise a solution that does not require the whole page to be rendered out and then redirected to the hashtaged URL and then rerendered again.
Finally, I have watched the intro video on the App Framework and it mentioned that they are using the Handlebars template engine. I am using Twig as my template engine on the server side. Is it possible to use an alternative template engine with the app framework? In particular the twig js engine.
I need a way for cache images and html files in PhoneGap from my site. I'm planning that users will see site without internet connection like it will be with it. But I see information only about sql data storing, but how can I store images (and use later).
To cache images check out this library -of which I'm the creator-:
imgcache.js
. It's designed for the very purpose of caching images using the local filesystem. If you check out the examples you will see that it can also detect when an image fails to be loaded (because you're offline or you have a very bad connection) and then replaces it automatically with the cached image. The user of the webapp doesn't even notice it's offline.
As for html pages.. if they're html static files, they could be stored locally in the web app (file:// in phonegap).
If they're dynamically generated pages, check the localStorage API if you have a small amount of data, otherwise the filesystem API.
For my web app I retrieve only json data from my server (and process/render it using Backbone+Underscore). The json payload is stored into the localStorage. If the application gets offline, it will fetch json data from the localStorage instead of the server (home-baked fork of Backbone.dualStorage)
You then get the full offline experience: pages+images.
Caching like you might need for simple offline operation is not exactly that easy.
Your first option is the cache manifest. It has some limitations (like the size of the cache) but might work for you since it was designed to do what you want.
Another options is that you can store content on the disk of the device using the file system APIs. This has some drawbacks like security and the fact that you have to load the file from a path / url that is different than you might normally load it from on the web. Check out the hydra plugin for an example of this.
One final option might be to store stuff in localStorage (which has the benefit of being private on all platforms) and then pull it out of there when needed ... that means base64'ing all your images tho so that is a pretty big departure from just standard caching.
Caching is very much possible on Android OS. but on Apple as stated above there are limitations with the size of the images and cache size etc.
If you are willing to integrate and allow the caching on iOS you can use "cache manifest" to do so. but keep the draw backs and limitations in mind.
Also
if you want to save the file to Documents folder under my App, Apple will reject your App. The reason is the system backup all data under Documents folder to iCould after iOS6, so Apple does not allow big data like images or JSON file which could sync from your server again to keep in this folder.
So there is another work around which is good So one can use LocalFileSystem.TEMPORARY instead. It does not save the data to Library/Cache, but it save data to temp folder of App, which does not been auto backup to iCloud and not auto deleted either.
Regards
Rajeev