AWSS3TransferUtility
通过(AWS-iOS-SDK v2.4.x)上传图像时,我正在努力定义缓存控制。
我的简化用法如下:
let utility = AWSS3TransferUtility.S3TransferUtilityForKey("key")
let data = UIImageJPEGRepresentation(image, 0.9)!
let expression = AWSS3TransferUtilityUploadExpression()
expression.progressBlock = { (task, progress) in
onProgress?(progress: progress.fractionCompleted)
}
transferUtility.uploadData(data, bucket: GlobalConfig.awsS3DefaultBucket, key: "image.jpeg", contentType: "image/jpeg", expression: expression) { (task, error) in
// ...
}
我目前的重点是表达,但调用 likeexpression.setValue("max-age=3600", forRequestParameter: "Cache-Control")
不起作用。