內容簡介
當本地開發時,常常會使用從生產環境匯出的資料庫備份。對於大型網站,由於圖片上傳量龐大,因此無法輕易地將生產環境的圖片上傳至本地環境中。
像 Pilothouse 這樣的本地環境工具可讓您將圖片上傳從生產環境代理到本地環境,但如果您在本地主題副本中新增或更改一個註冊的縮略圖尺寸,那麼這種方法就不太適用,因為新的縮略圖尺寸無法從生產環境代理,因為它在那裡不存在。您也無法在本地生成所需的縮略圖尺寸,因為原始圖片文件不存在於本地。
CDN Image Proxy 解決了這個問題,它利用 Jetpack Image CDN(曾用名 Photon)來代理從生產環境上傳的圖片。 Jetpack Image CDN 將自動生成並提供所需的任何縮略圖尺寸,但 CDN Image Proxy 將要求其在生產伺服器上尋找原始圖像,而不是在本地URL上尋找。
結果是,您可以隨時在本地添加或更改註冊的圖像尺寸,而 Jetpack Image CDN 將生成並提供所需的任何縮略圖尺寸的 CDN URL,並從位於生產環境上的原始圖像文件中提取。
外掛標籤
開發者團隊
原文外掛簡介
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 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 (formerly Photon) to proxy image uploads from your production site. 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.
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.
