Amazon S3和的Cloudfront缓存,如何清除缓存或同步其缓存缓存、Amazon、Cloudfront

由网友(借个火,我想抽掉寂寞)分享简介:我有运行,每10分钟,并更新内容类型和X-AMZ-元cron作业。但由于昨天好像cron任务运行后,亚马逊是不是捡发(刷新自己的高速缓存)的变化。I have a cron job that runs every 10 minutes and updates the content-type and x-amz-me...

我有运行,每10分钟,并更新内容类型和X-AMZ-元cron作业。但由于昨天好像cron任务运行后,亚马逊是不是捡发(刷新自己的高速缓存)的变化。

I have a cron job that runs every 10 minutes and updates the content-type and x-amz-meta. But since yesterday it seems like after the cron job run, Amazon is not picking up the changes made (refreshing his cache).

我还跟并手动进行的更改,但没有改变...

I even went and made the changes manually but no change...

当视频被上传它有一个应用程序/ x-MP4 内容类型和cron作业它更改为视频/ MP4

When a video is uploaded it has a application/x-mp4 content-type and the cron job changes it to video/mp4.

虽然S3具有正确的内容类型视频/ MP4 CloudFront的节目应用程序/ x-MP4 (旧的内容 - 型)....

Although S3 has the right content type video/mp4 cloudfront shows application/x-mp4(old content-type) ....

在cron作业一直致力于为最近6个月没有问题。

The cron job has been working for the last 6 months without a problem.

什么是错的亚马逊缓存?我怎样才能同步缓存?

What is wrong with amazon caching? How can i synchronize the caching?

推荐答案

使用失效通知,清除缓存,你可以把路径要清除,或者干脆使用通配符来清除所有文件。

Use Invalidations to clear the cache, you can put the path to the files you want to clear, or simply use wild cards to clear everything.

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#invalidating-objects-api

这也可以做使用API​​! http://docs.aws.amazon.com/AWSSDKforPHP/latest/index.html#m=AmazonCloudFront/create_invalidation

This can also be done using the API! http://docs.aws.amazon.com/AWSSDKforPHP/latest/index.html#m=AmazonCloudFront/create_invalidation

在AWS PHP SDK现在有方法,但如果你想使用一些较轻看看这个库: http://www.subchild.com/2010/09/17/amazon-cloudfront-php-invalidator/

The AWS PHP SDK now has the methods but if you want to use something lighter check out this library: http://www.subchild.com/2010/09/17/amazon-cloudfront-php-invalidator/

user3305600的解决方案并没有因为它设置为零的工作就是使用原产地缓存头的等价物。

user3305600's solution doesn't work as setting it to zero is the equivalent of Using the Origin Cache Headers.

阅读全文

相关推荐

最新文章