When I change a .phtml it is not reflected in the browser until after approximately 24 hours.

I've tried everything, run php bin/magento cache:flush, check the permissions of magento_user.

I'm using Magento 2.2 on Apache tomcat

Has it happened to anyone else?

  • did you use cloudfare ?? – Jigs Parmar Sep 13 '18 at 12:34
  • have you set up varinsh with full page cache! ? – Hammad Khalid Sep 13 '18 at 13:56
  • May i know if your website is on localhost or any third party hosting ? – Sourabh Kumar Sharma Sep 14 '18 at 10:30
  • Seems issue with you server cache, contact your server guy about this problem there must be a way to refresh cache on server. (I am not talking about Magento cache) – Kumar M Sep 14 '18 at 11:13
  • Its something similar with what i am currently facing.. i have magento2 setup up on nginx with varnish configured with full page cache magento. After each change in a phtml file, i have to restart varnish for it to apply. Even changing a static block content gets updated on the frontend after restarting varnish! – Hammad Khalid Sep 14 '18 at 15:42

php bin/magento cache:flush is used when you change .php files. When you change .phtml or .XML files you have to deploy static content.

try this,

php bin/magento setup:static-content:deploy

and afterthat

php bin/magento cache:flush

  • Thanks for your response. I already did what you said before but the problem continues. – Petón Sep 13 '18 at 13:57

Try to remove data from pub\static\frontend

and then run php bin/magento s:s:d

Clear data from




Check if you are on developer mode or production mode

Also try checking once in incognito window.

  • 1
    i do not think phtml files are deployed under static.. its .html, js, css – Hammad Khalid Sep 13 '18 at 13:54
  • Thanks for your response, LAW. I already did what you said before but the problem continues. I'm in developer mode – Petón Sep 13 '18 at 13:56
  • I agree with you Hammand Khalid, what's more, the changes in CSS I see them correctly – Petón Sep 13 '18 at 14:00

Give these commands,and run this in browser again.U can see it within seconds.

cd /bin

php magento setup:upgrade

php magento setup:di:compile

php magento setup:static-content:deploy –f

php magento cache:flush


Turn on the template hints for the site in the admin.

enter image description here

enter image description here

You will need to clear cache after you make this change. Right now you are assuming that you are editing the correct file. If caching is not the issue the odds are good you are editing the wrong template.

enter image description here

This has nothing to do with the deploy of static files. .phtml files are't served in the pub folder. The only relates to .js, .css and .html files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.