Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
457 views
in Technique[技术] by (71.8m points)

caching - Magento 2: Change Image Cache Key / Image Cache Path

We have just upgraded from Magento CE 2.2.4 to Magento CE 2.4.1. After upgrading our product image pathes have changed. For example:

<image id="category_page_grid" type="small_image">
<width>200</width>
<height>200</height>
</image>

Before upgrading these images had the following pathes:

pub/media/catalog/product/cache/e960f294cf534815b24fe57fbd9f1a95/

After upgrading the pathes / cache key have changed to:

pub/media/catalog/product/cache/a0ecae6a984b270d9c4e075a6d93d0bc/

We need to keep the 'old' cache keys / images pathes, but I could not find a way to achieve this.

Is there a way to change the image cache URLs in Magento 2? Unfortunately, redirects are not an option in this case. We need to physically change the URLs to their former version / using the former cache keys.

Any help is very much appreciated - thanks a lot!

Best wishes, Alex

question from:https://stackoverflow.com/questions/65643662/magento-2-change-image-cache-key-image-cache-path

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...