A faster route to deploying static content in Magento 2? Dev to Live etc?

前端 未结 8 677
名媛妹妹
名媛妹妹 2021-01-30 07:02

This is my environment. Please note this is also set in the relevant development modes and production modes.

Dev:
https://ar.dev.loc/
https://en.dev.loc/

Live:
         


        
8条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 07:47

    Since I use -j (--jobs) option to fork a new process, I reduce the static-content:deploy time from more than 10 minutes to less than one minute. See Magento/Deploy/Process/Queue.php

    php bin/magento setup:static-content:deploy -j[JOBS_AMOUNT]
    

    --jobs option enable parallel processing using the specified number of jobs. The default is 4. To cause the task to run in one process (for example, if your system does not support process forking), use --jobs 1. // see: devdocs.magento.com

    This option can be used only if pcntl is enabled.


    pcntl

    No external libraries are needed to build this extension.

    Process Control support in PHP is not enabled by default.

    You have to compile the CGI or CLI version of PHP with --enable-pcntl configuration option when compiling PHP to enable Process Control support.

    Note: Currently, this module will not function on non-Unix platforms (Windows).

    Note: that pcntl_fork will not work if PHP is being run as an Apache module, in which case this function will not exist!

提交回复
热议问题