laravel / ideas

Issues board used for Laravel internals discussions.
939 stars 28 forks source link

Config and Route Cache uses file instead of Cache #1119

Open dbpolito opened 6 years ago

dbpolito commented 6 years ago

Looking at the code i noticed:

https://github.com/laravel/framework/blob/5.6/src/Illuminate/Foundation/Console/ConfigCacheCommand.php#L56-L58 https://github.com/laravel/framework/blob/5.6/src/Illuminate/Foundation/Console/RouteCacheCommand.php#L65-L67

Both files basically goes to:

Is there any reason for not using Laravels Cache with whatever cache driver set?

$ cat bootstrap/cache/routes.php | wc -m
1006055
$ cat bootstrap/cache/config.php | wc -m
42294

Maybe it won't make any difference as it's just loading a simple array. 👍

deleugpn commented 6 years ago

Configs are needed in order to config the Cache system. How would you load your cached configs from your cache that hasn't been configured yet because it needs the configs inside itself to work? The same concept applies to Cached Routes. The Application Bootstrapping doesn't have a dependency on itself.