Service Worker Offline Caching for Client Applications

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing computing systems fail to efficiently preserve client application functionality when disconnected from a remote server system, as they lack a mechanism to handle user interface events and network requests in offline scenarios.

Innovation Solution

Implementing a service worker within the client application that intercepts and caches UI events and network requests, storing them in a local data structure for replay when the network is unavailable, using the Service Worker API and IndexedDB for persistent storage, allowing the client to provide responses and maintain functionality in offline mode.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the client application relies on network connection to access remote server system, then it can access real-time data and functionality, but it cannot operate when network connection is unavailable

Engineering Contradiction:
Improveapplication functionalityVSAvoidoffline operation capability
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The service worker intercepts and caches UI events and network requests/responses during online operation before offline mode is needed. This preliminary caching enables the client application to replay these events and maintain functionality when the network connection becomes unavailable, resolving the contradiction between relying on real-time network access and needing offline operation capability

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If the client application caches UI events and network requests locally, then it can operate offline by replaying cached data, but it increases device complexity and storage requirements

Engineering Contradiction:
Improveoffline operation capabilityVSAvoidsystem architecture
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The service worker acts as an intermediary component between the client application and the network, intercepting UI events and network requests, caching them locally using IndexedDB, and managing their replay during offline mode. This intermediary approach enables offline operation without requiring fundamental changes to the core client application architecture, thus increasing adaptability while limiting the growth of overall system complexity

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system creates simplified copies of UI events and network requests/responses and stores them locally in IndexedDB. These cached copies can be replayed during offline operation, enabling the client application to function without real-time network access. This copying mechanism provides offline capability while keeping the implementation relatively simple by working with serialized event data rather than implementing complex local application logic

Inventive Principle:
Principle #26Copying

Data Source

PatentUS10999399B2Offline use of network application
Publication Date: 2021.05.04 SAP SE
  • US10999399B2 patent drawing
  • US10999399B2 patent drawing
  • US10999399B2 patent drawing

AI summary

A system includes display of user interface, detection of a UI event associated with the user interface, interception of a request to a network triggered by the UI event, generation of a cache key based on the UI event, reception of a response to the request from the network, generation of a data structure including the response, and storage of the data structure in the persistent storage system in association with the cache key.