Login

    Register

Managed Hosting

PROJECT CATEGORIES

 

Amazon S3 REST Wrapper
Project Home Blog Forums Known Issues External Project Link Contact Project

Amazon S3 REST Wrapper Issue: Feature Request: add metadata info to 'putObject' so you can add cache-control/expires info to S3 files

Name: Feature Request: add metadata info to 'putObject' so you can add cache-control/expires info to S3 files
ID: 2
Project: Amazon S3 REST Wrapper
Type: Enhancement
Area: Code
Severity: Low
Status: Fixed
Related URL:
Creator: hungry
Created: 07/20/08 6:58 PM
Updated: 12/15/08 3:12 AM
Description: by default S3 does not seem to have any cache-control/expires info which can cause browsers to request the file every time it is referenced...

would be great to add a little "cache" option to this method to easily set these additioanl things...these can be set with a metadata call in the REST call...it's also possible to set this to existing files as well.

thanks,
jerad
History: Created by hungry (jerad) : 07/20/08 6:58 PM

Comment by hungry (hungry) : 12/14/08 11:51 AM
adding two headers to the PutObject function gets this done.

<cfhttpparam type="header" name="Cache-Control" value="max-age=2592000">
<cfhttpparam type="header" name="Expires" value="#DateFormat(now()+30,'ddd, dd mmm yyyy')# #TimeFormat(now(),'H:MM:SS')# GMT">

works great - especially now with cloudfront. you can really get more out of S3 using cache-control and far future headers.
check out YSlow for more info.

you can close this ticket.
thanks.

Updated by danziger (Joe Danziger) : 12/15/08 3:12 AM
Added in new version 1.7

To add a comment to this bug, please login using the link above.