yiisoft / config

Configuration management
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
31 stars 11 forks source link

Save in cache merge-plan or config. #158

Closed terabytesoftw closed 8 months ago

terabytesoftw commented 9 months ago

The idea basically is that the configuration is not built every time, if it has not changed, which normally happens, when we are in production.

samdark commented 8 months ago

Merge plan is kinda cached already. It's in a PHP file and it's saved to opcache if it's turned on.

Configs themselves aren't easy to cache (especially when they use getenv() or need other runtime context. I've tested the caching and it was slower than current code because of de-serialization of closures and these runtime stuff. Another issue is that if there's an error in the config, an exception will point to the cache, not to the actual config file.

vjik commented 8 months ago

Oh, yes. Builded config already cached in memory.