我在@R_502_196@中使用image_filter调整大小来调整Amazon S3中的一堆图像.我希望能够保存已调整大小的图像,以便对于第二次和后续的图像请求,不需要调整大小.我已经研究了如何在@R_502_196@中缓存原始图像,所以至少不会从S3连续检索图像,但我无法弄清楚如何在@R_502_196@服务器上缓存已调整大小的图像.这可能吗?
这是我的@R_502_196@配置的相关部分(所有这个服务器都是调整图像大小):
location / {
try_files $uri @resizer; # directive to tell it to first look locally,then look @resizer
root /var/www/@R_502_196@-default/images/;
image_filter resize 400 300;
image_filter_buffer 2048M;
image_filter_jpeg_quality 75;
image_filter_transparency off;
error_page 415 = /empty;
}
location @resizer {
proxy_pass http://my-s3-bucket;
proxy_store on;
proxy_temp_path /var/www/@R_502_196@-default/cache$uri;
proxy_store_access user:rw group:rw all:r;
image_filter resize 400 300;
image_filter_buffer 2048M;
image_filter_jpeg_quality 75;
image_filter_transparency off;
root /var/www/@R_502_196@-default/images/;
error_page 415 = /empty;
}
location = /empty {
empty_gif;
}
任何想法……?
最佳答案
见Igor Sysoev的this forum post和Foswiki的this entry.