0
0
Supabasecloud~20 mins

Caching strategies in Supabase - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Caching Mastery in Supabase
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Cache Invalidation

Which caching strategy ensures that cached data is updated only when the original data changes, minimizing stale data?

ACache-aside where application checks cache first and updates cache on misses
BWrite-through caching where data is written to cache and database simultaneously
CEvent-driven invalidation where cache is cleared when data changes occur
DTime-based expiration where cache clears after a fixed time interval
Attempts:
2 left
💡 Hint

Think about how the cache knows when to update without waiting for a timer.

Architecture
intermediate
2:00remaining
Choosing Cache Location for Supabase

You want to reduce latency for users globally accessing your Supabase database. Which caching location provides the best balance between speed and data freshness?

AEdge caching using a CDN close to users
BClient-side caching in the user's browser
CServer-side caching within the Supabase backend
DDatabase-level caching inside Supabase's Postgres
Attempts:
2 left
💡 Hint

Consider where the cache is closest to users and how often data changes.

Configuration
advanced
2:00remaining
Configuring Cache-Control Headers in Supabase Storage

You want to configure your Supabase Storage bucket to cache images in browsers for 1 day. Which Cache-Control header value achieves this?

A"no-cache, no-store"
B"private, max-age=3600"
C"public, max-age=31536000, immutable"
D"public, max-age=86400"
Attempts:
2 left
💡 Hint

1 day equals 86400 seconds. Public means cacheable by browsers and CDNs.

security
advanced
2:00remaining
Cache Security Risks in Supabase APIs

Which caching practice can lead to exposing sensitive user data when using Supabase APIs?

AUsing cache invalidation on data updates
BCaching authenticated API responses without user-specific keys
CCaching public data responses with short expiration
DEncrypting cached data at rest
Attempts:
2 left
💡 Hint

Think about what happens if cache stores data for multiple users together.

service_behavior
expert
2:00remaining
Supabase Realtime Cache Behavior

When using Supabase Realtime to listen for database changes, what happens to cached data in your application if you do NOT update the cache on receiving events?

ACache remains stale until manually refreshed or expired
BCache automatically updates with new data from Realtime events
CCache clears itself when Realtime events occur
DCache duplicates data causing inconsistent reads
Attempts:
2 left
💡 Hint

Realtime events notify your app, but do not change cache automatically.