Since CYJS automatically detects loss of network, it manages its own internal page caching with indexedDB, which works with all current good browsers.
All the already visited pages loaded with CYLoadPage() and all your own web services requests made with CYExec() remains available offline.
CYLoadPage() can also be used as a page pre-loader via your config.js file.
In the demo, once you’re connected, set your device or computer to offine, and you will see that you can still use all the available pages ;).
More powerful : ine th demo, turn your computer offline, wait 10 seconds maxi for network loss detection, then try to rename or delete a file in Dropzone panel – just click on an icon and select your action – , or update anything in the editor panel then save it, CYJS will automatically prompt you asking you if it must sync that request once the network will be back, so just click OK, then CYJS will automatically do these requests when the network will be back. Any CYExec() call will be cached that way, but you can decide to force no caching on special requests.

// Login function CYLoginFct = function() { CYLoadPage('login'); // Default: no login, direct page access //CYLogin('MyUsername'); //CYLoadPage(cyDefaultPage); // Pages preloading CYLoadPage('cyjsui', 'dummy'); CYLoadPage('cyjstables', 'dummy'); CYLoadPage('cyjscalendar', 'dummy'); CYLoadPage('cyjscrm', 'dummy'); CYLoadPage('myfirstpage', 'dummy'); };
The internal cache is enabled by default.
Set cyCache to false in config.js if you don’t want to use it.
Set property cache: false in options when calling CYExec() to avoid automatic caching.
Use CYLoadPage() in config.js to preload all the pages you would like available when coming offline.