0
0
Firebasecloud~20 mins

Bundle preloading in Firebase - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bundle Preloading Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Bundle Preloading Purpose

What is the main benefit of using bundle preloading in a Firebase web app?

AIt delays loading of all bundles until the user interacts with the app.
BIt compresses all bundles into a single file to reduce network requests.
CIt reduces the initial load time by loading critical code bundles before they are needed.
DIt automatically caches bundles only after the user closes the app.
Attempts:
2 left
💡 Hint

Think about how preloading affects when code is downloaded.

Configuration
intermediate
2:00remaining
Configuring Bundle Preloading in Firebase Hosting

Which Firebase Hosting configuration snippet correctly preloads a JavaScript bundle named main.js?

A{ "headers": [{ "source": "/main.js", "headers": [{ "key": "Cache-Control", "value": "preload" }] }] }
B{ "headers": [{ "source": "/main.js", "headers": [{ "key": "Link", "value": "</main.js>; rel=preload; as=script" }] }] }
C{ "headers": [{ "source": "/main.js", "headers": [{ "key": "Preload", "value": "script" }] }] }
D{ "headers": [{ "source": "/main.js", "headers": [{ "key": "Link", "value": "</main.js>; rel=stylesheet" }] }] }
Attempts:
2 left
💡 Hint

Look for the correct HTTP header and relation type for preloading scripts.

Architecture
advanced
2:30remaining
Optimizing Bundle Preloading Strategy

You have a Firebase app with multiple code bundles. Which strategy best balances fast initial load and efficient bandwidth when using bundle preloading?

APreload only the main bundle and defer others until needed.
BPreload all bundles at once on the first page load.
CNever preload any bundles and load all on demand.
DPreload only the smallest bundle regardless of usage.
Attempts:
2 left
💡 Hint

Consider user experience and network usage trade-offs.

security
advanced
2:00remaining
Security Implications of Bundle Preloading

What is a potential security risk when improperly configuring bundle preloading in Firebase Hosting?

ADisabling HTTPS for preloaded bundles.
BAutomatically encrypting bundles causing runtime errors.
CBlocking all network requests due to preloading headers.
DExposing sensitive code bundles to unauthorized users by preloading them publicly.
Attempts:
2 left
💡 Hint

Think about who can access preloaded resources.

service_behavior
expert
3:00remaining
Effect of Bundle Preloading on Firebase Hosting Cache Behavior

When you add a Link header with rel=preload for a bundle in Firebase Hosting, how does it affect the browser cache behavior for that bundle?

AThe browser fetches and caches the bundle early, improving load speed on subsequent navigations.
BThe browser ignores caching and always fetches the bundle from the server.
CThe bundle is cached only if the user explicitly refreshes the page.
DThe bundle is removed from cache immediately after preloading.
Attempts:
2 left
💡 Hint

Consider how preloading interacts with browser caching mechanisms.