{"action":"created","issue":{"url":"https://api.github.com/repos/TalAter/UpUp/issues/100","repository_url":"https://api.github.com/repos/TalAter/UpUp","labels_url":"https://api.github.com/repos/TalAter/UpUp/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/TalAter/UpUp/issues/100/comments","events_url":"https://api.github.com/repos/TalAter/UpUp/issues/100/events","html_url":"https://github.com/TalAter/UpUp/issues/100","id":178137846,"number":100,"title":"[Question] Is there a way to fetch assets from cache immediately when offline? and skip fetching from network until connection to the server is re-established?","user":{"login":"ericj17","id":4195650,"avatar_url":"https://avatars.githubusercontent.com/u/4195650?v=3","gravatar_id":"","url":"https://api.github.com/users/ericj17","html_url":"https://github.com/ericj17","followers_url":"https://api.github.com/users/ericj17/followers","following_url":"https://api.github.com/users/ericj17/following{/other_user}","gists_url":"https://api.github.com/users/ericj17/gists{/gist_id}","starred_url":"https://api.github.com/users/ericj17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericj17/subscriptions","organizations_url":"https://api.github.com/users/ericj17/orgs","repos_url":"https://api.github.com/users/ericj17/repos","events_url":"https://api.github.com/users/ericj17/events{/privacy}","received_events_url":"https://api.github.com/users/ericj17/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-20T18:26:46Z","updated_at":"2016-09-20T20:58:52Z","closed_at":null,"body":"Hi there,\r\n\r\nIs there a way to fetch from cache directly and not go to network, until connection to the server is re-established?\r\n\r\n## Context\r\nI have a long list of assets to be cached (includes js, html files (used to compose parts of a modal popup), css files, etc.). My web app will load an offline read only version of my app when disconnected. The user can open a detailed view (a modal popup) of selected data, the data model is stored in local storage. This all is working, but the offline page is very slow to load all the assets because for each asset, it is trying to fetch from the network first. Once network fetch fails and times out, then it will fetch from cache. Is there a way to fetch from cache directly and not go to network, until connection to the server is re-established?\r\n\r\n## Your Environment\r\nMy web app is built on ASP.NET MVC and hosted on IIS.\r\nI am able to successfully trigger the loading of an offline read only version of my app with upup.\r\n\r\nFirefox: 49.0\r\n\r\nLet me know if anything needs further clarification.\r\n\r\nThank you very much for this library and help,\r\nEric"},"comment":{"url":"https://api.github.com/repos/TalAter/UpUp/issues/comments/248432212","html_url":"https://github.com/TalAter/UpUp/issues/100#issuecomment-248432212","issue_url":"https://api.github.com/repos/TalAter/UpUp/issues/100","id":248432212,"user":{"login":"TalAter","id":926653,"avatar_url":"https://avatars.githubusercontent.com/u/926653?v=3","gravatar_id":"","url":"https://api.github.com/users/TalAter","html_url":"https://github.com/TalAter","followers_url":"https://api.github.com/users/TalAter/followers","following_url":"https://api.github.com/users/TalAter/following{/other_user}","gists_url":"https://api.github.com/users/TalAter/gists{/gist_id}","starred_url":"https://api.github.com/users/TalAter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TalAter/subscriptions","organizations_url":"https://api.github.com/users/TalAter/orgs","repos_url":"https://api.github.com/users/TalAter/repos","events_url":"https://api.github.com/users/TalAter/events{/privacy}","received_events_url":"https://api.github.com/users/TalAter/received_events","type":"User","site_admin":false},"created_at":"2016-09-20T20:58:52Z","updated_at":"2016-09-20T20:58:52Z","body":"> This all is working, but the offline page is very slow to load all the assets because for each asset, it is trying to fetch from the network first. Once network fetch fails and times out, then it will fetch from cache. Is there a way to fetch from cache directly and not go to network, until connection to the server is re-established?\r\n\r\nDoes this happen when you are truly offline, or is it just a slow connection setting? If you are offline, the request from the server should return an error immediately, and not wait for a timeout... unless there is something specific to your app that somehow sets that long timeout.\r\n\r\nIt could be helpful if you were to include some code that reproduces this issue.\r\n\r\nIn any way, the offline state is detected by the fact that requests fail. Relying on the connection status as reported by the browser is not reliable."}}
{"actor":{"display_login":"TalAter"}}