[wordpress插件] CDN Image ProxyCDN映像代理

wordpress 插件 文章 2020-03-19 23:00 452 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

When developing locally, it’s common to use a database dump from a production site.

在本地进行开发时,通常会使用生产站点中的数据库转储。

With large sites, it’s also common that the production site’s image uploads cannot be easily copied to the local environment, because there are simply too many of them.

在大型网站上,生产站点的图像上传通常很容易被复制到本地环境,这是很常见的。

While local environments like Pilothouse allow you to easily proxy image uploads to your local environment from the

Pilothouse 这样的本地环境使您可以轻松地将图像上传代理从本地

production site, that doesn't work so well if you add or change one of the registered thumbnail sizes in your local copy of the theme, since the new thumbnail size can't be proxied from production as it doesn't exist there.

生产站点,如果您在主题的本地副本中添加或更改注册的缩略图大小之一,则效果不佳,因为新的缩略图大小不能从生产中替代,因为新的缩略图大小在那里不存在。

You’re also not able to regenerate the needed thumbnail sizes locally, because the original image file is not present locally.

您也无法在本地重新生成所需的缩略图尺寸,因为原始图像文件不在本地显示。

CDN Image Proxy solves this problem by using Jetpack Image CDN (

CDN Image代理通过使用 Jetpack Image CDN

formerly Photon) to proxy image uploads from your production site.

以前是Photon)代理从您的生产站点上传的图像。

Jetpack Image CDN will automatically generate and serve any required thumbnail size on-the-fly, but CDN Image Proxy will tell it to look for the original image on your production server, rather than on your local URL.

Jetpack Image CDN会自动即时生成并提供任何所需的缩略图大小,但是 CDN Image Proxy 会告诉它在生产服务器上而不是本地URL上查找原始图像。

The result is that you can add or change registered image sizes locally whenever you want, and Jetpack Image CDN will generate and provide a CDN URL for whatever thumbnail size is required, sourced from the original image file located on the production site.

结果是您可以随时在本地添加或更改注册的图像大小,并且Jetpack Image CDN会生成并提供所需缩略图大小的CDN URL,该URL取自生产站点上的原始图像文件。

安装步骤

    1. Install and activate CDN Image Proxy on your local site
    2. 在本地站点上安装并激活 CDN Image代理

    3. Install and activate Jetpack on your local site
    4. 在本地站点上安装并激活 Jetpack

    5. Go to Settings > Media and save your production site’s URL in the field provided.
    6. 转到设置>媒体,然后在提供的字段中保存生产站点的URL。

    You can also define your production site’s URL as a constant in wp-config.php, like so:

    您还可以在 wp-config.php 中将生产站点的URL定义为常量,如下所示:

    define( 'CDN_IMAGE_PROXY_REMOTE_URL', 'http://example.com' );

      define('CDN_IMAGE_PROXY_REMOTE_URL','http://example.com');

下载地址
https://downloads.wordpress.org/plugin/cdn-image-proxy.zip
-EOF-

AI助手支持GPT4.0