Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add craft config/cache as a console command #1607

Closed
khalwat opened this issue Apr 8, 2017 · 1 comment
Closed

Add craft config/cache as a console command #1607

khalwat opened this issue Apr 8, 2017 · 1 comment
Labels
enhancement improvements to existing features

Comments

@khalwat
Copy link
Contributor

khalwat commented Apr 8, 2017

Something analogous to to the Laravel artisan config:cache would be really useful for production deployment: https://laravel.com/docs/master/configuration#configuration-caching

It could combine all of the craft/config files into one cached file for faster loading, and take all of the PHPdotenv settings and coalesce them into this cached config file so that it could be loaded quickly, without having to parse the .env for every request.

As per the PHPdotenv docs:

phpdotenv is made for development environments, and generally should not be used in production. In production, the actual environment variables should be set so that there is no overhead of loading the .env file on each request. This can be achieved via an automated deployment process with tools like Vagrant, chef, or Puppet, or can be set manually with cloud hosts like Pagodabox and Heroku.

This is a perfect type of thing to be added as a Craft console command via craft config/cache or such. If the cache file exists, great, use it, and don't parse anything in craft/config. If it doesn't exist, parse as normal.

You'd essentially just be preflighting something that's the same for every request, and eliminating unnecessary overhead.

@khalwat
Copy link
Contributor Author

khalwat commented Feb 18, 2019

Dotenvy gets us part of the way there, anyway: https://github.com/nystudio107/dotenvy

@brandonkelly brandonkelly added enhancement improvements to existing features and removed feature labels Mar 5, 2019
@craftcms craftcms locked and limited conversation to collaborators Jun 22, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
enhancement improvements to existing features
Projects
None yet
Development

No branches or pull requests

3 participants