Starting from Terraform 1.4.0, the lockfile is always checked before using the cache directory, meaning that Terraform will perform a full initialization even if the cache is present. To solve this, one can either continue using Terraform 1.3.x as the new 0.11 version, set TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE=true, or start using the lockfile and move forward. Lockfiles are recommended for repeatability and security reasons, ensuring consistent provider versions and protecting against supply chain attacks. The process of adding lockfiles involves validating the Terraform configuration, generating lockfiles using pre-commit hooks, and automating their updates in the CI workflow. Renovate and dependabot are alternative options, but they are not utilized in the discussed approach.