使用PHP AWS-SDK缓存受CloudFront保护的链接

时间:2012-02-03 02:29:47

标签: php amazon-s3 amazon-cloudfront

我们有一个用于生成S3上受保护资产的链接的类,我们也尝试与cloudfront链接。

AWS-SDK for php提供了一种用于缓存生成的链接的缓存机制。这适用于受保护的S3链接,但不会为CloudFront链接生成缓存。

这不受支持吗? 要么 这是我应该向维护者报告的错误吗?

//caching does not work here 
    function _generate_cf($bucket, $filename, $time){
        $this->_cf = new AmazonCloudFront();
        return $this->_cf->cache('1 hour')->get_private_object_url($bucket, $filename, $time);
    }

//caching does work here
    function _generate_s3($bucket, $filename, $time){
        $this->_s3 = new AmazonS3();
        return $this->_s3->cache('1 hour')->get_object_url($bucket, $filename, $time);
    }

0 个答案:

没有答案
相关问题