5

After making a change to app/etc/di.xml

Am I required to take some additional steps in order for the change to take effect?

Like clean cache, deploy static files or compile code?

Manoj Deswal
5,80325 gold badges29 silver badges50 bronze badges
asked Sep 25, 2017 at 9:55
2
  • yes sure, please run clean cache and deploy static files. Commented Sep 25, 2017 at 9:58
  • 2
    Why you modify here [app/etc/di.xml] ? Commented Sep 25, 2017 at 10:00

4 Answers 4

3

Yes, you need to recompile after you have done some changes in di.xml file and then it's a good practice to remove cache too.

php bin/magento setup:di:compile

A nice answer is here for your reference. Hope it will give you a better idea.

answered Sep 25, 2017 at 10:02
1
  • @PrincePatel it's my pleasure. Commented Sep 25, 2017 at 10:11
0

This is also possible through the Admin UI.

  1. Go to: System > Cache Management
  2. Check "Configuration" in the table
  3. In the dropdown over the table choose "Refresh" and click "Submit".
answered Jan 6, 2022 at 10:13
0

Just do a php bin/magento setup:upgrade, it will clean all caches and remove generated folders as well.

answered Jan 6, 2022 at 10:25
-1

You can also remove the folders inside the var/ like

  • generation
  • cache
  • page_cahceapart from.htaccess` file

Then run the command php bin/magento c:f,

Manoj Deswal
5,80325 gold badges29 silver badges50 bronze badges
answered Sep 25, 2017 at 10:43
1
  • The question has specific case scenario. Your suggestion will remove not only every cache type which is not necessary, but when you remove whole generation directory, it is mandatory to run di:compile when Magento is not in developer mode. Commented Apr 18, 2024 at 8:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.