3

When I add useAppcache="true" in lightning application (<aura:application useAppcache="true">), I see that the manifest file is added in the html tag and the cache is enabled (from the browser logs), but when I go offline and reload tge application, the screen displays only the 'loading' message and does not load the application pages from the cache.

I am accessing the lightning application from desktop chrome browser

Any help is greatly appreciated.

  • Are you leveraging any static resources in your application? By default these URLs are not going to end up in the manifest and could be one reason that offline is not working for you. – Doug Chasman Jul 1 '15 at 13:48
  • Hi Doug, thanks for your reply. Currently I am just having some static text, to test the application and that is not working. I am not referring any external css/js/or any other resources. – VVV Jul 1 '15 at 19:53
1

I believe the issue is that your test application is so simplified that it is being rendered entirely server side (something that almost never happens).

With this app:

enter image description here

it gets rendered (HTML generation) server side and that apparently is at odds with useAppCache="true". If you look in the js console you'll see an exception:

Uncaught ReferenceError: $A is not defined

if you make any change that causes to switch into full client side rendering for the app (e.g. add a dummy javascript controller) the appcache dance will complete correctly:

enter image description here

|improve this answer|||||
  • Hi Doug, I had added a dummy controller since I saw the error in javascript console. It still does not work for me. The caching happens when I am connected to the internet, but does not load the page when I am offline. So, after adding useAppCache=true, does your lightning application load when offline? Also, if yes, does it work in S1 app in offline mode? Thanks a lot for your reply! – VVV Jul 2 '15 at 18:00
  • its clear about the appcache , as its the same issue as browser looks for an update on manifest file. but the page loading is entirely blocked and it shows only the loading symbol when we go offline. – Sid Dec 22 '16 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.