You want to configure your Remix app to serve static assets via a CDN while ensuring cache busting on asset updates. Which approach is best?
hard📝 Application Q15 of 15
Remix - Performance
You want to configure your Remix app to serve static assets via a CDN while ensuring cache busting on asset updates. Which approach is best?
AUse a fixed asset URL and rely on browser cache only
BSet CDN cache to never expire and manually clear cache on updates
CServe assets directly from the Remix server without CDN
DUse hashed filenames for assets and update CDN cache rules accordingly
Step-by-Step Solution
Solution:
Step 1: Understand cache busting with CDN
Hashed filenames change when content changes, forcing CDN and browsers to fetch new files.
Step 2: Evaluate options for cache management
Use hashed filenames for assets and update CDN cache rules accordingly uses best practice: hashed filenames plus CDN cache rules. Others risk stale content or no CDN benefits.
Final Answer:
Use hashed filenames for assets and update CDN cache rules accordingly -> Option D