cancel
Showing results for 
Search instead for 
Did you mean: 

Turn on Minify CSS on production mode

SOLVED

Turn on Minify CSS on production mode

Hi,

 

I have been working on speed issue on mobile.

On Google Speed Insights, the website is around 14%, and is not good at all.

 

I would like to switch on 'minify css' and 'minify js', but on live website we are not allowed to use developer mode, and we are unable to switch on them.

 

Would we be able to turn them on without enabling developer mode?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Turn on Minify CSS on production mode

Hello @tvgarden 

 

you need to run below sql into your db

 

UPDATE `core_config_data` SET `value`='1' WHERE `path`='dev/js/minify_files';
UPDATE `core_config_data` SET `value`='1' WHERE `path`='dev/css/minify_files';

hope it will help you.

 

if works then mark as solution

 

more info :- 

https://magento.stackexchange.com/questions/187954/magento-2-how-to-disable-minify-css-js-setting 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

View solution in original post

3 REPLIES 3

Re: Turn on Minify CSS on production mode

Hi @tvgarden,

There is only way to change without switching to developer mode.. using database table..

Open core_config_data table and search in path like %css%, you will get the record.. then change the value from 0 to 1.

I hope it will help you!

Re: Turn on Minify CSS on production mode

Hello @tvgarden 

 

you need to run below sql into your db

 

UPDATE `core_config_data` SET `value`='1' WHERE `path`='dev/js/minify_files';
UPDATE `core_config_data` SET `value`='1' WHERE `path`='dev/css/minify_files';

hope it will help you.

 

if works then mark as solution

 

more info :- 

https://magento.stackexchange.com/questions/187954/magento-2-how-to-disable-minify-css-js-setting 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Turn on Minify CSS on production mode

@tvgardenHey,

 

I believe you know what you are doing. Before making any of those change make sure to perform the same on your test/staging environment. I would recommend make all those change and test on your stage environment. You need to test the speed as well in there. If you see some improvement then only think of moving it in production.

 

Enabling minify css/js directly on production without testing would may cause a lot more downtime then you may be thinking of.

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.