Does Packer automatically invalidate cached ISOs when remote sources change without checksums?
0 reputation · 20 Jun 2021, 13:44 UTC
Cache freshness behavior
Packer stores downloaded ISO files in a local cache directory (default ~/.packer.d/cache) to avoid repeated downloads across builds. When a builder references an ISO URL without an explicit checksum parameter, the documentation indicates that Packer reuses the cached artifact if the URL matches.
Uncertainty around remote changes
If the remote ISO is updated—such as a vendor publishing a patched release at the same URL—Packer appears to have no built-in mechanism to detect that change using HTTP headers like ETag or Last-Modified. The cache is only invalidated when a user-supplied checksum mismatches or when the -force flag is used, which also discards other cached state.
Goal
Determine whether any automatic revalidation or cache-TTL feature exists in current Packer versions, or whether checksum maintenance remains the sole path to guaranteed freshness.
- Can Packer verify remote freshness without a full re-download when no checksum is provided?
- Is there a configuration option or plugin that adds
ETag/Last-Modifiedbased invalidation for the artifact cache? - What is the recommended workflow for teams that need both cache performance and assurance against stale vendor images?