DocumentationCommerceImplementation Playbook

PaaS only

Static content deployment best practices

Last update: November 1, 2024
  • Topics:
  • Best Practices

CREATED FOR:

  • Experienced
  • Developer

This article talks about static content deploy (SCD) best practices in Adobe Commerce to help avoid issues where the static content would not be available on your website.

Affected products and versions

All supported versions of:

  • Adobe Commerce on cloud infrastructure
  • Adobe Commerce on-premises

Best practices

To avoid an issue with static content not being available on your website, follow these best practices to make sure your static content is both configured and deployed correctly:

  1. Make sure to follow deployment guidelines:

    • For Adobe Commerce on-premises (all versions), see Deployment Overview in our developer documentation.
    • For Adobe Commerce on cloud infrastructure (all versions), see Cloud deployment process and Static content deployment strategies in our developer documentation.
  2. For Adobe Commerce on cloud infrastructure (all versions), ensure that ece-tools is on the newest release. See: Update ece-tools version in our developer documentation.

  3. For Adobe Commerce on cloud infrastructure (all versions), make sure that static content is deployed during the build phase rather than the deployment phase. See: Configuration management for store settings - Static content deployment performance in our developer documentation.

  4. Make sure that you do not have long-running cron jobs and kill any long-running cron processes. Long-running cron jobs can take up CPU resources and potentially greatly increase deployment time.

  5. For Adobe Commerce on-premises (all versions), check that the php process in CLI has access to the pub/static directory. Otherwise, you could face an issue where a static content deploy will be unable to write files to that directory. For more information: File systems access permissions in our developer documentation.

  6. Ensure the generated directory is not a shared directory across builds; otherwise, builds could fail randomly. For more information:

    • Adobe Commerce on-premises (all versions): Technical Details in our developer documentation.
    • Adobe Commerce on cloud infrastructure (all versions): Deployment process - Phase 2: build in our developer documentation.
  7. Check your SCD strategy. The quick strategy is the default. For more information:

    • Adobe Commerce on-premises (all versions): Static files deployment strategies in our developer documentation.
    • Adobe Commerce on cloud infrastructure (all versions): Deploy variables - SCD_STRATEGY in our developer documentation.

Additional information

In our developer documentation:

  • Static Content Container
  • Static Content Signing
  • Deploy variables - STATIC_CONTENT_SYMLINK
  • Deployment flow
  • Zero downtime deployment
  • Optimize cloud deployment
recommendation-more-help
754cbbf3-3a3c-4af3-b6ce-9d34390f3a60