This post is about speeding up content deployment inside magento 2. You can hire magento developers who can help you out in this subject and bring you the relative output. In this post, we will share some pro tips that will help your development team to achieve the target.
With experience in Magento 1.x the transition to Magento 2 will carry a lot of familiarity. The admin area still has all of the major components. You can also jump into the templating system and almost continue where you left off.
Something new that front end developers will find challenging is how you interact with your static files, specifically css. When you want to make edits you need to deploy your content. For front end developers there will be a steep learning curve if you are not used to using the console. With Magento 2 the Magento console will be a regular part of your workflow. From the start it will seem frustrating. You may not understand why but this is an opportunity to grow as developers and learn the new version of one of the world's largest ecommerce platforms.
We start with this command: magento setup:static-content:deploy
This command takes all of your “static” files that can be cached (CSS, Images, LESS files) from the theme folder and places them in the pub/static folder. To use this command the steps are outlined below.
This is a great improvement over what Magento 1.x. This allows for faster file access and has a built in css preprocessor. Once front end developers get over this learning curve they will grow to appreciate its benefits.
Read More : Magento Magical Theme From The Scratch
Once you run the command you will see this deployment in action. Each theme will show its progressional steps as highlighted by periods. Once it’s done you will see it move on to the next theme. However most stores only have one theme and redeployment of unchanged content is pointless. While this is a topic for future Magento 2 core developers to fix we as problem solving developers need a solution now.
The solution is simple. We delete the themes we don’t use. We do this with the following command:
Magento theme:uninstall --backup-code -c|--clear-static-content [your theme path] What this code snippet does is this:
As you can see the command is very thorough. Now you will have one less unused theme to compile thus speeding up your deployment and your overall deployment. Efficiency is key in development small amounts of time add up quickly when your goal is to get the site launched.
Run the magento setup:static-content:deploy command again and you will see that only your custom theme deploys.
As Magento 2 evolves I understand this is a topic that will be solved for future efficiency. But for now we have our workaround.
James Warner, author of this post has shared pro tips to speed up content deployment within magento 2. You can share this post with your hire Magento developers team and help them in completing their project with grace. You can even ask questions related to magento development from professionals.