Bifalgorithm post

"Look at this, my internet is off. But if I open Google Docs, it is opening properly without the internet connection. And not just even that, if I go to any offline document, I will be able to edit my document as well. How this is even possible? So this is actually called offline first architecture. And the magic behind it is something called Service Worker. The first time you open Google Docs, a service worker gets installed in your browser. Think of it like a tiny proxy server that sits between your application and the internet. The service worker quietly caches every important thing. like HTML, JSS, CSS, whatever is needed to render that webpage. And all these things will be stored locally in your browser. Now, the next time when you are opening the application, if there is no internet connection, then the service worker will check the local cache and it will respond directly from that local cache. And it feels like the app loaded instantly. No server needed. And this is where Google Docs goes on step further than caching. When you are editing any document, it will store all the steps, every key stock, every mouse movement, everything it will store in a special kind of database called IndexedV. This is available in every modern browser. Think of it like local storage, but better. So when you edit anything, the edit will directly go into the Index TV, not on Google server. And it is maintaining a local queue as well of all the changes that you are making. Now, the moment the internet comes back, the service order kicks in. It will sync all of your pending changes from the Index TV. to the cloud. No manual save or upload button clicking is needed. Spotify web application does the same thing with music and many other applications does the same thing as well. This whole pattern, work offline sync later, is the core idea behind a thing called progressive web app. Maybe you have heard of this term. So visit ons, cache everything and work offline. That's the offline first architecture. If you need my notes of this offline architecture, just comment offline and I will name that to you."

"Look at this, my internet is off. But if I open Google Docs, it is opening properly without the internet connection. And not just even that, if I go to any of…

Ideas in this flowchart

  • Offline First Architecture
  • Google Docs Functionality
  • Offline Access
  • Editing Offline Documents
  • Service Worker
  • Installation
  • Caching
  • Local Cache Usage
  • IndexedDB
  • Local Storage of Edits
  • Sync on Internet Connection
  • Progressive Web App
  • Work Offline, Sync Later
Feed/

"Look at this, my internet is off. But if I open Google Docs, it is opening properly without the internet connection. And not just even that, if I go to any offline document, I will be able to edit my document as well. How this is even possible? So this is actually called offline first architecture. And the magic behind it is something called Service Worker. The first time you open Google Docs, a service worker gets installed in your browser. Think of it like a tiny proxy server that sits between your application and the internet. The service worker quietly caches every important thing. like HTML, JSS, CSS, whatever is needed to render that webpage. And all these things will be stored locally in your browser. Now, the next time when you are opening the application, if there is no internet connection, then the service worker will check the local cache and it will respond directly from that local cache. And it feels like the app loaded instantly. No server needed. And this is where Google Docs goes on step further than caching. When you are editing any document, it will store all the steps, every key stock, every mouse movement, everything it will store in a special kind of database called IndexedV. This is available in every modern browser. Think of it like local storage, but better. So when you edit anything, the edit will directly go into the Index TV, not on Google server. And it is maintaining a local queue as well of all the changes that you are making. Now, the moment the internet comes back, the service order kicks in. It will sync all of your pending changes from the Index TV. to the cloud. No manual save or upload button clicking is needed. Spotify web application does the same thing with music and many other applications does the same thing as well. This whole pattern, work offline sync later, is the core idea behind a thing called progressive web app. Maybe you have heard of this term. So visit ons, cache everything and work offline. That's the offline first architecture. If you need my notes of this offline architecture, just comment offline and I will name that to you."

"Indexed DB"

👍
0
0 comments0 shares

Sign in to view and post comments.