为什么不CloudFront的返回这些相同的URL的缓存版本? [英] Why doesn't CloudFront return the cached version of these identical URL's?

查看:316
本文介绍了为什么不CloudFront的返回这些相同的URL的缓存版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对EB(运行Tomcat应用)的服务器,我也有一个CloudFront的缓存设置缓存重复请求,让他们不要去服务器。

I have a server on eb (running a tomcat application), I also have a CloudFront cache setup to cache duplicate requests so that they dont go to the server.

我有两个行为设置了

/artist/search
/Default(*)

和默认(*)设定为:

Allowed Http Methods  :GET,PUT
Forward Headers       :None
Headers               :Customize
Timeout               :84,0000
Forward Cookies       :None
Forward Query Strings :Yes
Smooth Streaming      :No
Restricted View Access:No

所以没有超时,唯一其转发的查询字符串

so there is no timeout and the only thing it forwards are queries strings

不过,我可以看着我的服务器ID收到重复的请求localhost_access_log文件中看到:

Yet I can see from looking at the localhost_access_log file that my server id receiving duplicate requests:

127.0.0.1 - - [22/Apr/2015:10:58:28 +0000] "GET /artist/cee3e39e-fb10-414d-9f11-b50fa7d6fb7a HTTP/1.1" 200 1351114
127.0.0.1 - - [22/Apr/2015:10:58:29 +0000] "GET /artist/cee3e39e-fb10-414d-9f11-b50fa7d6fb7a HTTP/1.1" 200 1351114
127.0.0.1 - - [22/Apr/2015:10:58:38 +0000] "GET /artist/cee3e39e-fb10-414d-9f11-b50fa7d6fb7a HTTP/1.1" 200 1351114

我还可以从我的CloudFront的青睐的对象页面看到有很多的物体击中有时想念有时还包括这些艺术家的网址,我期待只有一个小姐和那里所有剩下的是点击率

I can also see from my CloudFront Popular Objects page there are many objects that hit sometimes and miss sometimes including these artist urls, I was expecting only one miss and there all the rest to be hits

为什么会这样?

Why would this be ?

更新 寻找更仔细地看来(虽然不知道这),该不太可能被高速缓存作为艺术家页面尺寸的增加,但额外的古怪即使主艺术家页面较大它似乎也reget全部的寄托在该网页中引用如图标(PNG格式),而不是当艺人页面是很小的。这对我来说是最糟糕的结果,因为它是需要更多的处理在服务器上创建的大艺术家页面 - 这就是为什么使用CloudFront的尝试和避免这些页面在首位的娱乐我

Update Looking more carefully it seems (although not sure about this) that less likely to be cached as the size of the artist page increases, but extra weirdly even if the main artist page is larger it also seems to reget everthing referenced in that page such as icons (pngs) but not when the artist page is small. This is the worst outcome for me because it is the large artist pages that need more processing to create on the server - this is why I using cloudfront to try and avoid the recreation of these pages in the first place.

推荐答案

你们看到的是有两个原因的组合:

What you are seeing is a combination of two reasons:

  1. 在每个单独的CloudFront的POP请求单独对象,因此,如果你的观众在不同的位置,你可以期望多个查询到您的源服务器(他们会失误)
  2. 在我不知道有关报告的日期范围,你正在寻找,但最终CloudFront的少驱逐对象的流行,以腾出空间在高速缓存中的新对象

这篇关于为什么不CloudFront的返回这些相同的URL的缓存版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆