Magento的 - 亚马逊的Cloudfront CDN和缓存 [英] Magento - Amazon Cloudfront CDN and Caching

查看:352
本文介绍了Magento的 - 亚马逊的Cloudfront CDN和缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解CDN和缓存和我没有找到答案。

I am trying to understand CDN and caching and am not finding the answer.

如何使亚马逊的CDN缓存从源服务器上的图像缓存的图片吗?而且是有办法来测试它?

How do you make amazon cdn cache the images from your origin servers cached images? And is there a way to test for it?

我的CDN原点映射到我的服务器,所以当它没有找到

I have the CDN origin mapped to my server, so when it is not finding

<一个href="http://cdn.mywebsite.com/media/catalog/product/cache/1/small_image/190x/9df78eab33525d08d6e5fb8d27136e95/i/m/img101.jpg" rel="nofollow">http://cdn.mywebsite.com/media/catalog/product/cache/1/small_image/190x/9df78eab33525d08d6e5fb8d27136e95/i/m/img101.jpg

它,而不是查找

<一个href="http://mywebsite.com/media/catalog/product/cache/1/small_image/190x/9df78eab33525d08d6e5fb8d27136e95/i/m/img101.jpg" rel="nofollow">http://mywebsite.com/media/catalog/product/cache/1/small_image/190x/9df78eab33525d08d6e5fb8d27136e95/i/m/img101.jpg

您可以在Firebug看到,所有的Magento的缓存元素得到一个301永久移动,而静态文件得到确定200响应。另外,如果我进入CloudFront的URL,它会自动切换到我的网址为Magento的缓存内容,但仍作为CloudFront的URL为静态的。

You can see in Firebug, all the magento-cached elements are getting a 301 moved permanently, while the static files get an OK 200 response. Also if I enter the cloudfront URL it automatically changes to my url for magento-cached elements, but remains as the cloudfront url for the static ones.

如果我回去以后,甚至一整天,它从来没有使用CDN源,导致我相信它不是在亚马逊缓存我的Magento缓存的CSS / JS /图像。

If I go back later, even a full day, it never uses the CDN source, leading me to believe that its not caching my magento-cached css/js/images on Amazon.

如果我关闭缓存和放大器; JS / css的优化,那么它使http请求到CloudFront的CDN过量。

If I turn off caching & js/css optimization, then it makes an excessive amount of http request to the cloudfront cdn.

推荐答案

当的Cloudfront询问你的服务器(原点)的文件,由于某种原因,你的服务器是不是有200回答你应该检查你的日志和重写规则确定为什么的Cloudfront正在接收301的响应。

When Cloudfront asks your server (the origin) for the file for some reason your server is not answering with a 200. You should check your logs and rewrite rules to determine why Cloudfront is receiving the 301 response.

一解释我能想到的是,如果你有被重定向到www的规则。*等。

One explanation I can think of is if you've got a rule which redirects to www.*, etc.

这篇关于Magento的 - 亚马逊的Cloudfront CDN和缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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