在「Enable CORS in Amazon API Gateway」這邊看到 Amazon API Gateway 支援 CORS (Cross-origin resource sharing) 了,這樣前端頁面就可以直接 call 進去使用了...
文件可以在「Enable CORS for a Method in API Gateway」這邊看到,主要就是這個頁面的設定:
看起來是個小功能,但卻影響很大... 這代表又有一大塊開發者會進去研究。
幹壞事是進步最大的原動力
在「Enable CORS in Amazon API Gateway」這邊看到 Amazon API Gateway 支援 CORS (Cross-origin resource sharing) 了,這樣前端頁面就可以直接 call 進去使用了...
文件可以在「Enable CORS for a Method in API Gateway」這邊看到,主要就是這個頁面的設定:
看起來是個小功能,但卻影響很大... 這代表又有一大塊開發者會進去研究。
Amazon CloudFront 新增了 Whitelist Header 的功能:「Deliver Custom Content With CloudFront」。
如同在 post 裡說明的:
If you choose the Whitelist option, each header that you add to the list becomes part of the cache key for the URLs associated with the distribution.
有點像是 HTTP 協定裡 Vary
想要解決的問題,只是做在 CDN 這端。這個功能蠻多 CDN 都有,AWS 總算補上了...
這次除了可以針對 custom HTTP header 處理外,CloudFront 還做了不少事情:
前兩項還蠻有意義的,這代表會有人幫你更新資料。而 CloudFront 總算是支援 CORS 了...
直接看示範頁面就可以理解了:「jquery.adaptive-backgrounds.js • A jQuery plugin for extracting dominant colors from images and applying it to its parent」。
GitHub 的頁面在「briangonzalez/jquery.adaptive-backgrounds.js」。
如果圖片不在同一個 domain 下,會需要設定 CORS 權限 (Cross Origin Resource Sharing),或是在 img
tag 下指定 crossorigin
屬性讓程式可以讀取。