I was tasked with making the offline application available for my company. Before moving on to the actual stage of development, I want to be sure that my current strategy will not be a bust.
At first I thought about using the html5 application cache, but after several tests I found that it does not seem to cache the server side operations, but the actual html that is displayed (please correct me if I am wrong). This will not work, because the processed html depends on who is currently logged in. From my tests, it always displayed html, as if the last user who logged in to the system (on the network) logged in.
My current strategy is this: I only cache the login page and the offline (.html) page to match every aspx page that needs to be available offline. Each successful login (online) leads to the creation or updating of a Web SQL or IndexDB database (depending on the browser) with all the data necessary for this user to work, including a table that will be used for login credentials. Thus, the only requirement to enter offline mode is to log in with your login credentials at least once.
My concern is that I exaggerate this. To make this work, I will need to create an html page for each current page (many pages), and I will have to rewrite everything that is currently running on the server in JavaScript, including validation, database calls, populating controls like dropdown lists and data grids etc. Also, everything that I changed in the future will require subsequent offline changes.
Is there an established best practice for what I am trying to do, what I am losing sight of, or am I risking a new land?
source share