BunBundle.Plug.DevCache (bun_bundle v0.3.2)

Copy Markdown View Source

Sets no-cache headers on asset requests in development.

Ensures the browser always fetches fresh assets during development, avoiding stale-cache issues when files are rebuilt. Passes requests through untouched outside the :dev environment, so it can be plugged unconditionally:

# In your endpoint, before any static file plug.
plug BunBundle.Plug.DevCache

The headers are applied just before the response is sent, so caching headers set by Plug.Static (such as its immutable ?vsn= variant) are overridden rather than the other way around.

This module is only compiled when Plug is available.