fruitcake/magento2-custom-image-url
最新稳定版本:v0.1.1
Composer 安装命令:
composer require fruitcake/magento2-custom-image-url
包简介
Magento2 Custom Image URLS for the catalog
README 文档
README
Magento 2.4 has the option to set a dynamic URL (General -> Web -> Url options). This module adds an extra option to define the format of the URL.
Install
composer require fruitcake/magento2-custom-image-url
php bin/magento module:enable Fruitcake_CustomImageUrl
php bin/magento setup:upgrade
Configuration
You can configure the url in General -> Web -> Url Options. Set the 'Catalog media URL format' option to 'Image optimization based on query parameters'. This will prevent Magento from creating resized images. Select a Custom URL format for Imgproxy or Pattern, to use this module.
Pattern
Provide a pattern to replace the URL with:
Example https://example.com/{{path}}?w={{width}}&h={{height}}
The available filters (for urlencode etc) and variables are described in the config.
Imgproxy
Use the Imgproxy format, either with URL, S3 or Local files. You can provide a key/hash to sign the URLs
This can be used with the AWS Remote storage: https://devdocs.magento.com/guides/v2.4/config-guide/remote-storage/config-remote-storage-aws-s3.html
You can provide the host and options. The format will be generated by the module.
Inscecure proxy to map the URL + Convert to Webp:
docker run -p 8080:8080 -e IMGPROXY_ENFORCE_WEBP=1 darthsim/imgproxy
Example Docker config to proxy with S3 + Signature
docker run -p 8080:8080 -e IMGPROXY_USE_S3=1 -e AWS_ACCESS_KEY_ID=accesskey -e IMGPROXY_S3_REGION=eu-central-1 -e AWS_SECRET_ACCESS_KEY="secret" -e IMGPROXY_KEY=key -e IMGPROXY_SALT=salt darthsim/imgproxy
See https://docs.imgproxy.net/ for more options.
See imgproxy-nginx-cached.conf for an example nginx proxy config with caching enabled.
Todo / future ideas
- Other CDNs
- ..
License
MIT
统计信息
- 总下载量: 8.77k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-02-20

