从S3提供图像并通过pagespeed优化(缓存,缩放)

时间:2015-04-02 18:30:19

标签: apache nginx amazon-s3 pagespeed

我正在发布大图像并在客户端上调整大小。

今天我发现pagespeed可以调整图像大小并将其提供给客户端 嗯,听起来很棒,但设置起来并不容易。

现在发生了什么。

1. client request page
2. with ajax or json inside the initial page response, image url is provided
3. image url is at aws s3 (or I could set that image url to point to my server and proxy it)

如何将其作为以下内容..

1. client request page
2. ajax
3. image url point to my server
4. upon image request, my server gets the image from s3
5. perform the optimization as if the image was obtained from local (resize, cache)
6. give it to the user

PageSpeed and CDN images
Google mod_pagespeed for ajax loaded content
https://superuser.com/questions/768040/https-proxy-s3-aws-via-nginx-with-pagespeed

https://code.google.com/p/modpagespeed/issues/detail?id=599

似乎指出了答案,但很难理解它......

1 个答案:

答案 0 :(得分:0)

您只需要Nginx S3代理和Nginx图像过滤模块:http://nginx.org/en/docs/http/ngx_http_image_filter_module.html