Cache busting using Laravel Mix and CDN
summary
Shows how to combine Laravel Mix with an S3/CloudFront CDN to actually cache‑bust: sets Cache‑Control to one year, uploads build output to s3, and discovers query‑string versioning breaks because CloudFront can ignore ?id= and S3 replication can serve old objects. Demonstrates replacing query strings with file‑name hashing via the laravel-mix-versionhash plugin (or full webpack/js‑CLI) so new builds create new filenames and avoid stale cached assets — solution works in production.
AI-written summary · about
chapters (10)
- 0:00Start
- 4:25Install webpack-s3-plugin
- 7:55Cache Busting
- 9:06Versioned file name
- 9:26How do we reference assets URL on the CDN?
- 15:49In some cases, S3 might return previous version of the object
- 18:18Filename Based Versioning
- 19:56Install laravel-mix-versionhash
- 22:23JS Framework CLIS VA
- 23:29WRAP UP
related talks
28mTaking Laravel to the edge with HTTP caching & Varnish
29mLove your cache: Optimize for the second load
43mCache Me Outside - Caching Methodologies & Architectures
42mCaching for Cash
41mCaching Like a Pro: Best strategies for dealing with Drupal cache
25mCaching strategies on https://dev.to
34mThe underappreciated power of content invalidation
28mCaching the uncacheable in Varnish
