- Tech Monk
- Posts
- EP 8: Why do Apps offer Offline Modes? How They Work?
EP 8: Why do Apps offer Offline Modes? How They Work?
PWAs make websites act like apps—offline access, push alerts, camera use, and installable without app store fees or separate codebases.
Hello fellow Tech Monks👋! Let’s become the “Go-To” Software Engineer who’s always “Up-To-Date” with the latest tech. Learn a new Software Engineering Concept, every week!
You can also checkout: How Apps Like Instagram, Facebook Ship Features Without any Downtime
You’ve heard the hype. Now it’s time for results
After two years of siloed experiments, proofs of concept that fail to scale, and disappointing ROI, most enterprises are stuck. AI isn't transforming their organizations — it’s adding complexity, friction, and frustration.
But Writer customers are seeing a positive impact across their companies. Our end-to-end approach is delivering adoption and ROI at scale. Now, we’re applying that same platform and technology to bring agentic AI to the enterprise.
This isn’t just another hype train that doesn’t deliver. The AI you were promised is finally here — and it’s going to change the way enterprises operate.
See real agentic workflows in action, hear success stories from our beta testers, and learn how to align your IT and business teams.
Table of Contents
Before getting into Why do Apps offer Offline Modes? Let’s understand first Is Offline Mode Necessary for Every App?
The answer is: It depends.
When Offline Mode is Beneficial?
Unstable Internet: Essential for industries like engineering, transport, or tourism where connectivity is unreliable. Or in places like Kashmir with limited internet connectivity.
Large Data Processing: Improves performance for apps handling large data, like video display apps, by storing data locally.
Service Consistency: Critical for e-commerce apps to prevent data loss during connectivity drops.
When Offline Mode May Not Be Needed?
Live Streaming/Video Calling: These apps require constant internet for live interactions.
App Architecture: Implementing offline mode can be complex and costly if not initially designed for it.
Budget Constraints: Offline mode can increase development costs and may be added later when the budget allows.
How Do Offline Modes Work?
Implementing offline functionality in apps involves several strategies and technologies. Let’s look at few of them:
Local Storage:
Cache: Temporary storage of data on the device. Apps use caching to store frequently accessed data, allowing quick retrieval even without an internet connection.
Database: More complex data storage solutions like SQLite or Realm can be used to store data locally. These databases allow for the structured storage and querying of data, making it accessible offline.
Data Synchronization:
Background Sync: When an internet connection is available, the app syncs data between the local storage and the remote server. This ensures that the data remains up-to-date across all devices.
Conflict Resolution: When changes are made offline, they need to be synchronized with the server once connectivity is restored. This requires conflict resolution strategies to handle discrepancies between local and server data.
Progressive Web Apps (PWAs):
PWAs are designed to work offline using service workers, which are scripts that run in the background and manage network requests, caching, and data synchronization. PWAs provide a seamless offline experience similar to native apps.
Offline-First Design:
This approach prioritizes offline functionality from the start of the development process. By assuming the app will operate offline, developers create more robust and resilient applications.
User Interface Adjustments:
Apps need to provide clear indicators when they are in offline mode and offer features accordingly. For instance, showing cached articles in a news app or allowing offline editing in a note-taking app.
Examples of Offline Functionality
Google Maps: Allows users to download maps for offline navigation, which is particularly useful in areas with poor connectivity.
Spotify: Enables users to download playlists and albums for offline listening, saving data and providing uninterrupted music access.
Evernote: Provides offline access to notes, ensuring users can continue their work without an internet connection.
Let’s understand in depth, how offline modes work with PWA’s
But before that, What are PWA’s?
Progressive Web Apps (PWAs) make websites function like native mobile apps. When smartphones first appeared in 2008, they had features like offline mode, push notifications, cameras, and geolocation, which weren't available on the web. At that time, Internet Explorer limited web developers' access to these features. In the 2020s, the web has evolved to offer nearly all the features of native apps.
For example, the Twitter PWA can be installed like a native app, work offline, use the device camera, and receive push notifications. PWAs also offer better distribution without app store fees(30% cut in revenue) and run on iOS, Android, and the web from a single codebase.
How PWAs Work Offline?
The best thing about Progressive Web Apps (PWAs) is its ability to work offline, making them useful in situations where the internet is limited or unavailable.
Imagine you are on a train or going under a tunnel and you loose signal or maybe in you local library with a poor Wi-Fi, basically in areas with limited connectivity.
Let’s see how it is achievable through PWAs,
Service Workers:
Service workers are scripts that run in the background of your web app. They intercept network requests and manage caching and offline functionality.
You can see this Service Worker in the Applications tab under Dev Tools
Cache API:
Caching stores resources locally on your device for later use. There are two main types of caches:
Browser Cache: Automatically stores resources like images to speed up website loading. It's not directly controllable by developers.
Service Worker Cache: Managed by developers, it allows precise control over what gets stored and retrieved, ensuring essential assets are available offline.
Pre-Caching:
When the app is first loaded, the service worker can fetch and store important resources (like pages, CSS, images) in the cache. This is called pre-caching.
Handling Offline Requests:
If you go offline and request a resource, the service worker can intercept this request.
Instead of failing to load, the service worker checks the cache and serves the stored resource, allowing the app to function smoothly without an internet connection.
Improved Performance:
Even when online, retrieving resources from the cache is faster than making a round trip to the server. This improves the app’s performance.
Now it’s time to get into the practicalities! Let’s see all this in an actual PWA
Twitter introduced Twitter Lite, a streamlined version of its app, designed to use less data and function well with limited internet connectivity.
Features of Twitter Lite Offline Mode
Cached Content:
Tweets and Timelines: Previously loaded tweets and timelines are cached, so users can read tweets they’ve already seen, even offline.
Images and Videos: Media content that was loaded while online is available for offline viewing.
Service Workers:
Handle caching of content and manage network requests, ensuring cached content is served when offline.
Offline Notifications:
Users can receive push notifications about new interactions, which will be available once they go back online.
Data Saver Mode:
Reduces data usage by loading lower-resolution images and videos, making offline caching more efficient.
Retry Mechanisms:
Actions like posting tweets or sending messages are queued and retried once the connection is restored, ensuring user actions are not lost.
In this way Twitter Lite enhances the user experience by ensuring functionality and accessibility even with limited or no internet connectivity.
I hope this gives you a clear picture of why offline modes are so handy and how they make apps work even without a steady internet connection. Great job on diving into these concepts—you're one step closer to becoming the software engineer you want to be!
Keep learning. You’ve got this!