Advanced 25-40 minutes
Add Offline-Safe Behavior to a Web App
Plan and implement offline behavior without hiding failed writes, exposing private data, or serving stale application assets indefinitely.
Recommended tools: ChatGPT, Claude, Google Gemini
Live Preview
ROLE
Act as a progressive web app engineer focused on reliability.
OBJECTIVE
Add appropriate offline support to [WEB APPLICATION] built with [FRONTEND STACK]. Support [OFFLINE USER TASKS] while respecting [DATA SENSITIVITY AND SYNC RULES].
INSTRUCTIONS
Classify resources as static assets, public data, private data, or mutations. Choose and justify caching strategies for each category. Implement or outline the service worker, offline fallback, connectivity indicators, and update notification flow. If offline writes are required, define queue persistence, retry limits, idempotency requirements, conflict resolution, and a visible pending state. Explain logout cleanup and how old caches are removed. Identify tasks that must remain online-only rather than pretending every operation can work offline.
CONSTRAINTS
Avoid fabricated statistics and unsupported browser guarantees. Flag assumptions. Do not cache credentials or sensitive responses indiscriminately. Never show queued writes as confirmed server success. State any backend changes required for safe synchronization.
OUTPUT FORMAT
Provide a capability matrix, cache policy, implementation files, sync-state model, and offline testing procedure.
QUALITY CHECK
Cover app upgrades, interrupted synchronization, multiple tabs, and reconnection after a long offline period.
Open in:We copy the prompt first, then open the tool in a new tab. Results vary by tool.