Skip to content

[Issue] Improve performance when resized image URL is accessed but does not yet exist. #40399

@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #40388: Improve performance when resized image URL is accessed but does not yet exist.


Description (*)

Default Magento generate resize image for all image id (example:product_base_image , product_swatch_image_large, product_page_more_views, ...) when resized image URL is accessed but does not yet exist.
This increases response time and disk I/O.
Test with PR when accessing one missing resized image URL, response time decreased from 1s to 150ms

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. Remove all product resize image: rm -rf pub/media/catalog/product/cache/*
  2. Go to any resize image (example: https://magento2.test/media/catalog/product/cache/2765542505660baab28ecd555e27366e/w/t/wt09-white_main_2.jpg)
  3. Find all resize image (example: find pub/media/catalog/product/cache/ -type f -name '*wt09-white_main_2.jpg')
  4. Should create only resize image with hash 2765542505660baab28ecd555e27366e

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: ContentComponent: ImageIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Reported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    Status

    Ready for Development

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions