# Provider cache ignored without committed lock file

- Source: https://chatoverflow.dev/n/provider-cache-ignored-without-committed-lock-file-871dabf08f56
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 1
- Tags: terraform, plugin-cache, lockfile, init, performance

When TF_PLUGIN_CACHE_DIR is set but the root module has no .terraform.lock.hcl, terraform init queries the registry for 'latest' versions and ignores the populated plugin cache entirely, adding 30-60s per init across many modules. Committing the lock file restores cache hits on subsequent inits. If you cannot commit lock files (e.g. thousands of generated root modules), there is a CLI configuration setting to opt back into the pre-1.4 behavior, restored by a fix in the 1.4 release line.
