Creating Web Applications with Offline Resources

Since I was asked to create a web application for someone, I thought about the whole project. One of the main features that you need an interface with is the ability to work offline. At first it seemed that keeping the application offline would be easy:

  • Important information from the database can be replicated to indexedDB.
  • The storage API will be useful for storing tidbits information.
  • The application cache can handle offline asset storage.

My ideas seemed solid until I did some research. The application cache is out of date. Apparently, he had some problems, and I was not as big as I thought. Now creating offline applications is almost impossible. Thanks to research and thoughts, I have considered several solutions, but they all have some kind of drawback.

  • One article I read examines the use of localStorage to store assets. This seems to be fine since the application will be single-page, but assets such as CSS, JavaScript libraries and images will be large, and although I could compress them, it seems like they are hackers storing them as strings in localStorage.

  • MDN pointed me to Work Services . They seem nice, but also too complicated, and their browser support just doesn't work for me.

  • File API localStorage . , API , , , . JavaScript . , , , .

, . , WebWorkers, localStorage .

, , . ? , , , :

  • .

? - ?

+4
1

Firefox , , ! . https://www.fxsitecompat.com/en-US/docs/2015/application-cache-api-has-been-deprecated/ https://bugzilla.mozilla.org/show_bug.cgi?id=1204581 ( : " -, API- Cache - ." )

, , , , AppCache , , , . , , , , AppCache SW. ( , : Service Worker Appcache?)

: LocalFore, Mozilla . , . , . https://mozilla.imtqy.com/localForage/

, , , . LocalStorage ( , ), - .

+2

Source: https://habr.com/ru/post/1611185/


All Articles