Cover image for a blog "How PWAs Works Offline"

How PWAs Work Offline: A Guide by Profstep

This blog explores Progressive Web Apps (PWAs), which combine the best of both web and mobile apps. It will help businesses and users understand how PWAs work offline, store data, and offer a seamless, app-like experience without requiring downloads. So, let’s see how PWAs can boost user engagement and accessibility offering uninterrupted access, anytime, anywhere.

8 min read

Offline PWA and How Does Offline App Work?

Progressive Web Apps (PWAs) are a new type of app that combines the best of web and mobile apps.

They deliver a fast, reliable, and engaging user experience even when the user is offline. PWAs are directly browsable from a browser and can function without an ongoing internet connection, making them very convenient for users who are constantly on the go.

 

Offline Functionality of PWAs

One of the best features of PWAs is that they can work offline. This is made possible through a technology called service workers. 

Service workers are scripts that run in the background of your browser, allowing PWAs to cache important content and make it available even without an internet connection.

When you first visit a PWA, it stores data (like images and text) on your device. The next time you open the app, it can show the stored content instantly, even without Wi-Fi. It’s like having a bit of the app saved on your phone for offline use!

As for space, most PWAs don’t take up much room compared to traditional apps because they don’t need to be fully downloaded. The amount of space it uses depends on the size of the PWA and how much data it caches. If you're worried about storage, you can always check and delete unused PWAs from your phone.

Diagram showing how PWAs store data in cache for offline use

Where and What PWA Data Is Stored

PWAs store that data in three main places:

  • Cache
    This is where the app stores temporary files like images, scripts, and stylesheets. These files help the app load faster and ensure that it works offline by allowing access to essential resources without needing to re-download them.
     
  • Local Storage
    This simple storage option is used for small pieces of data, such as user preferences, login details, or session information. It’s ideal for saving simple data between sessions and ensures that the app remembers user settings.
     
  • IndexedDB
    A more powerful storage solution, IndexedDB acts as a built-in database in your browser, allowing PWAs to store larger amounts of data. This includes media files, large datasets, or user-generated content. 
    IndexedDB ensures offline functionality by saving structured data directly in your browser's storage, which can be accessed even when you're offline. It’s typically hidden from users but can be accessed through your browser’s developer tools.
     
  • Cookies
    These are used for storing session information, authentication tokens, and user preferences. Cookies help maintain user sessions, making it easier for users to stay logged in or retain personalized settings across sessions.

Does It Impact Security?

Generally, PWAs are considered secure, but like any web-based technology, there are a few considerations:

  1. HTTPS Protocol : Most PWAs are served over HTTPS, ensuring that data exchanged between the app and server is encrypted. This protects against man-in-the-middle attacks and keeps your data safe during transmission.
     
  2. Local Storage Vulnerabilities : While local storage and cookies are useful for PWAs, they can be potential entry points for malicious attacks if not properly managed. For example, unprotected data stored in local storage can be accessed by other websites or apps if there’s a vulnerability in the browser.
     
  3. Limited Access : Unlike native apps, PWAs have restricted access to system resources (like your camera, microphone, or location data) unless explicitly granted by the user. This reduces the risk of unauthorized access compared to traditional apps.
     
  4. Regular Updates : PWAs are updated automatically whenever the developer pushes out a new version, making it easier to apply security patches quickly. However, you should ensure the PWA is from a trusted source to avoid potential threats.

 

How to Protect Your Privacy While Using PWAs:

  • Clear Cache Regularly : Clearing the cache and other stored data can help remove any unnecessary information and improve privacy.
     
  • Use Trusted PWAs : Only install PWAs from trusted sources and websites to minimize the risk of encountering a malicious app.
     
  • Review Permissions : Make sure you’re aware of what data the PWA is accessing (location, camera, etc.) and only grant necessary permissions.
     
  • Monitor Updates : Keep your PWA and browser up to date to ensure you’re protected with the latest security features.

 

Managing and Using PWAs

Knowing how to manage and use PWAs is super helpful, whether you're a business owner or just someone who loves smooth digital experiences. PWAs are like a mix between websites and apps, bringing the best of both worlds without taking up too much space.

 

How PWAs Update?

So, how do PWAs stay up-to-date? Well, they don’t require you to manually update them like traditional apps. 

They’re designed to automatically update in the background whenever you visit a site that supports PWAs. When developers release a new version, the PWA quietly downloads and updates itself. This way, users always get the latest features without needing to do anything extra.

 

Controlling Automatic Downloads

Don't prefer automatic downloads or installs? No worries, you can control that as well!

On Android , you can access your browser settings and prevent PWAs from automatically installing. 

  • Open the browser you use (Google Chrome, for example).
     
  • Tap the three-dot menu in the top-right corner.
     
  • Select “Settings.”
     
  • Scroll down to find the “Site settings” option.
     
  • Tap on “Install apps from this site” and toggle it off.

 

While  iOS  does not include an easy "turn off" PWAs feature, you can dissuade PWAs from being installed by simply not tapping on the "Add to Home Screen" button when you are asked. If a PWA is already installed, however, you can remove it by pressing and holding on the app icon, selecting "Remove App," and tapping on "Delete."

 

The process on laptops may vary slightly depending on your browser, but most browsers used today enable you to control PWAs. Here's the process for  Google Chrome :

  • Open Chrome and go to the website you don’t want to install as a PWA.
     
  • Click the three-dot menu in the top-right corner.
     
  • Choose “Settings.”
     
  • Scroll down to “Privacy and Security.”
     
  • Click “Site Settings.”
     
  • Under “Additional Content Settings,” find “Installed Apps” and set it to "Ask" instead of "Auto-install."

 

If you're a developer who doesn't want your PWA to install automatically onto users' devices, you can change your web app's manifest file. 

 

Specifically, you can change the "display" property to "browser" instead of "standalone." This will prevent your PWA from automatically installing onto the home screen.

Also, you can use the "beforeinstallprompt" event in JavaScript to control when the install prompt will be shown, so it will only appear when you think the user is ready.

 

How to Delete a PWA from Your Device

Progressive Web Apps (PWAs) are great for quickly accessing websites, but if you no longer need one, deleting it is easy and won't affect your other apps or browsing data. 

On Android :

  1. Open the browser where you installed the PWA.
  2. Navigate to the PWA you want to remove.
  3. Tap the three dots in the top-right corner of the browser window.
  4. Select Remove from Home Screen or Uninstall App.

This will delete the PWA from your home screen without affecting any of your other apps or browser data.

 

On iOS :

  1. Open Safari and go to the PWA you want to delete.
  2. Tap the share button (the square with an upward arrow).
  3. Scroll down and tap Delete App.

The PWA will be removed from your home screen, freeing up space, while leaving your browsing data and other apps intact.

 

On Windows :

  1. Open the Start Menu and search for the PWA.
  2. Right-click on the PWA's icon in the Start Menu or on your desktop.
  3. Select Uninstall or Remove from Start.

You can also go to Settings > Apps, find the PWA in the list, and click Uninstall.

 

On macOS :

  1. Open the Applications folder and find the PWA.
  2. Drag the PWA’s icon to the Trash, or right-click and choose Move to Trash.
  3. Empty the Trash to permanently delete it.

 

How to Clean the Cache from a PWA Without Deleting It

Over time, Progressive Web Apps (PWAs) may store data in the form of cached files to improve performance. While this can help the app run faster, it might also take up unnecessary space or cause issues with loading outdated content. Fortunately, clearing the cache from a PWA is simple and won't delete the app itself.

On Android :

  1. Open Settings on your device.
  2. Go to Apps & Notifications or App Info (this may vary by device).
  3. Scroll down and find the PWA in the list of apps.
  4. Tap on the app, then go to Storage & Cache.
  5. Tap Clear Cache.

This will remove temporary files without affecting your app or its data, making it run more efficiently.
 

On iOS :

Unfortunately, iOS does not allow you to clear the cache for individual PWAs directly. However, you can clear the cache by removing and re-adding the PWA from your home screen:

  1. Follow the steps to delete the PWA (as mentioned earlier).
  2. Once deleted, revisit the website in Safari and reinstall the PWA by tapping the Share button and selecting Add to Home Screen.

This will effectively clear the cache without removing any of your saved browser data.

 

On Windows :

  1. Open Settings and navigate to Apps.
  2. Scroll down and find the PWA in the list of installed apps.
  3. Select the app, then click Advanced Options.
  4. Click Reset. This will clear the cache and reset the app, but won’t delete the app itself.

 

On macOS :

  1. Open Safari and go to Safari > Preferences from the top menu.
  2. Click on the Advanced tab and check Show Develop menu in menu bar.
  3. Go to the Develop menu and select Empty Caches.

This will clear the cache for any PWAs installed via Safari without affecting their functionality.

By clearing the cache, you can ensure that your PWA continues to run smoothly, without accumulating unnecessary files or outdated content, while keeping the app intact.

 

Use Cases of PWAs

Who do PWAs serve, then? Pretty much everyone! Businesses love PWAs because they offer a faster, more reliable way to engage with users. 

For businesses, PWAs create a channel for staying in touch with users despite their offline or poor connection state. This proves to be valuable for industries like e-commerce, media, and tourism. 

As an example, a travel website can allow the user to check their bookings or itinerary even when not using the internet, and thus it will be more reliable and user-friendly.

 

E-commerce websites also have much to gain from PWAs by providing an app-like smoother shopping experience without the necessity for an app install. Customers are able to shop, view their cart, and even make transactions offline or in low-connectivity areas—a benefit for business and consumers alike.

 

Users, meanwhile, get to have smooth, app-like experiences without the inconvenience of downloading or updating apps. And with offline capabilities, PWAs ensure you can still access important information when you're offline, whether you're traveling, on the move, or in poor reception areas.

The best part? PWAs work across all devices—you can be on Android, iPhone, or laptop. So no need to make different apps for different platforms. It's one-for-all solution that gives a smoother and more consistent experience for the user.

 

Check out our related blog

Cover image for a blog explaining about Progressive Web Application (PWA)