Offline persistence allows your app to save data locally on the device so it can work without an internet connection and sync changes when back online.
Click to reveal answer
beginner
How do you enable offline persistence in Firebase Firestore for a web app?
You enable it by calling firebase.firestore().enablePersistence() before using Firestore.
Click to reveal answer
beginner
What happens to data changes made while offline in Firebase?
Changes are saved locally and automatically synced to the server when the device reconnects to the internet.
Click to reveal answer
intermediate
Name one limitation of Firebase offline persistence.
Offline persistence has limited storage size and may not support complex queries while offline.
Click to reveal answer
beginner
Why is offline persistence important for mobile apps?
It improves user experience by allowing the app to work smoothly without internet and prevents data loss during connection drops.
Click to reveal answer
How do you enable offline persistence in Firebase Firestore for a web app?
ASet offline: true in config
BCall firebase.firestore().enablePersistence()
CUse firebase.database().goOffline()
DNo action needed; it's automatic
✗ Incorrect
You must explicitly call enablePersistence() to turn on offline support in Firestore web apps.
What happens to data written while offline in Firebase Firestore?
AIt is saved locally and synced later
BIt is sent to the server immediately
CIt is lost until connection returns
DIt causes an error
✗ Incorrect
Firestore saves offline writes locally and syncs them automatically when online.
Which Firebase product supports offline persistence by default on mobile?
AFirebase Hosting
BFirebase Authentication
CFirebase Firestore
DFirebase Cloud Functions
✗ Incorrect
Firestore supports offline persistence by default on Android and iOS.
What is a common limitation of offline persistence in Firebase?
ANo local data storage
BRequires manual sync
CNo syncing when online
DLimited local storage size
✗ Incorrect
Offline persistence has limited storage capacity on the device.
Why is offline persistence useful for users?
AIt allows app use without internet
BIt speeds up internet connection
CIt disables data syncing
DIt deletes old data
✗ Incorrect
Offline persistence lets users keep using the app even without internet.
Explain how Firebase offline persistence works and why it is useful.
Think about how apps keep working without internet and then update later.
You got /4 concepts.
Describe how to enable offline persistence in Firebase Firestore and mention one limitation.
Focus on setup steps and what might not work well offline.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of enabling offline persistence in Firebase Firestore?
easy
A. To speed up internet connection
B. To save data locally so the app works without internet
C. To encrypt data on the server
D. To backup data to another cloud service
Solution
Step 1: Understand offline persistence concept
Offline persistence allows the app to store data locally on the device.
Step 2: Identify the benefit
This local storage lets the app work even when there is no internet connection.
Final Answer:
To save data locally so the app works without internet -> Option B
Quick Check:
Offline persistence = local data storage for offline use [OK]
Hint: Offline persistence means local data storage for offline use [OK]
Common Mistakes:
Thinking it speeds up internet
Confusing with data encryption
Assuming it backs up to another cloud
2. Which Firebase Firestore method correctly enables offline persistence in a web app?
easy
A. firebase.firestore().enablePersistence()
B. firebase.firestore().startPersistence()
C. firebase.firestore().enableOffline()
D. firebase.firestore().activatePersistence()
Solution
Step 1: Recall the official method name
The correct method to enable offline persistence is enablePersistence().
Step 2: Check other options
Other options like startPersistence(), enableOffline(), and activatePersistence() are not valid Firebase Firestore methods.
Final Answer:
firebase.firestore().enablePersistence() -> Option A