Strategy for caching config in multi-container deployed apps with blue green deployments? #55042
-
This issue #55028 gave us the idea of this question. Until now we did not found a perfect strategy in using cached configs. Reasons:
Based on this we evaluate caching the configs impossible in this scenario. Funny thing is that the community pays attention to the time gained by caching the configs but disregards the time lost by using reflection on each class that supports php attributes, even if they are not used and even suggesting octane as a solution. So, can anyone present e bulletproof solution for config caching in the above scenario? Update. config:cache merges all configs in 1 file and has nothing to do with Cache facade. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
This is your problem - the rest of the deployment process is designed to avoid config mis-matches and this roll-back is what breaks this process. |
Beta Was this translation helpful? Give feedback.
-
This sounds like you're sharing the result of |
Beta Was this translation helpful? Give feedback.
The
config:cache
command generates a file atbootstrap/cache/config.php
, it doesn't use the framework's cache component at all. Caching the config (or any of the caches warmed up through theoptimize
command) has nothing to do with data cached using the Cache component, think of it more as a "cache this data that shouldn't change over the lifetime of a deployment" warmup step as you push a deployment live.Where this could cause problems is if you're caching the config at a point before the real values are set, i.e. something's being configured by an env var but those env vars aren't set in your build process; the
config:cache
command in Laravel is just a simplevar_export($config, true)
…