Question

Whenever I edit app/design/frontend/Dzinehub/Theme/web/css/styles-l.css , it doesn't get reflected in the front end when I load the site .After every change , I have to clear the cache and run static content-deploy for the changes to appear.Is there any other way ?

Was it helpful?

Solution 4

I just found the answer myself , You need to enable the apache server rewrite. Just follow these steps if you are a linux user ,Goto terminal and type

sudo a2enmod rewrite

You need to restart the web server now to apply the changes:

sudo service apache2 restart

OTHER TIPS

You could run: setup:static-content:deploy OR delete the file(s) manually pub/static/frontend/...

While developing the first approach could be extremely slow so personally I prefer to remove the created files.

You can find a detailed explanation about code clean here

BTW: It is preferable edit .less instead .css files to maintain scalable and 'neat' your theme code.

If you set Magento to be in developer mode,"Static view files are not cached; they are written to the Magento pub/static directory every time they’re called" as it describes here: http://devdocs.magento.com/guides/v2.0/config-guide/bootstrap/magento-modes.html

You can set developer mode with cli: bin/magento deploy:mode:set developer.

Also make sure you've disabled the Magento cache through the admin, and review the link I proved above which talks about the other modes available in Magento 2.

Clear / Flush Magento cache by typing “php bin/magento cache:flush”.

In this step, we are setting up static content to deploy on our Magento store. To perform this, type “php bin/magento setup:static-content:deploy”.

And finally, to Reindex Magento Static Blocks type “php bin/magento indexer:reindex”.

I hope this may work for you. :)

Clear static files in cache management then run deploy.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top