This project is read-only.

Expires and Cache-Control Headers

Apr 16, 2008 at 1:24 AM
SpaceBlock application is great!

However, I do not see a way to add HTTP headers when you upload files.

e.g. adding an Expires and Cache-Control headers.

User meta data gets x-amz-meta- prefixed to the header, so the browser won't recognize them.

I have read that you can post headers such as Expires using the REST protocol, so AFAIK this support just needs to be added to the SpaceBlock application.
Apr 16, 2008 at 1:36 AM
On the transfer dialog, you have a column "User Metadata" and right-click "Edit User Metadata" bring up a name/value pair edit screen. Just adding a "HTTP Headers" column and right-click "Edit custom HTTP Headers" with an identical name/value pair edit screen would suffice as a quick solution.

I've downloaded the source code, but you could probably add this quicker than it would take me to browse it.

I'd really like to upload all my static images with something like:

Cache-Control: public
Expires: Wed, 31 Dec 2014 18:00:00 GMT

Given S3 charges for requests in addition to bandwidth, this is really best practice for content that will never change.
Coordinator
Apr 18, 2008 at 5:49 PM
Thanks for the suggestion - you're right, this should not be difficult to add to SpaceBlock (it is already supported by the underlying S3 library).

Look for this to show up in a day or two.
Jun 11, 2008 at 5:02 PM
This ability is great.  One small addition I'd like to see is to "remember" values used in the Edit Metadata dialog box so it's easier to consistently set them each time you do an upload.  Making the entry field a combo-box containing the previously used values would be an adequate, and hopefully simple, solution for my needs. Alternatively, being to define named metadata settings and apply them during a transfer would be a perfect solution for me.
Coordinator
Jun 12, 2008 at 2:09 AM
I've been thinking about putting a "maintain existing metadata" option on the transfers dialog, so that if the file exists on s3, the transferred file would automatically get the same metadata/acl without have to respecify it.  This would help for iterative transfers, where you want to quickly upload/re-upload the same file with the same metadata.

Would that solve your problem as well?  (I'm trying to kill two birds with one stone here...)
Jun 12, 2008 at 4:34 AM
The problem with that solution for me is that I'm updating a bunch of files as once.  If there happens to be a new one in the stack I don't notice, it won't get the appropriate headers.


JohnSpurlock wrote:
I've been thinking about putting a "maintain existing metadata" option on the transfers dialog, so that if the file exists on s3, the transferred file would automatically get the same metadata/acl without have to respecify it.  This would help for iterative transfers, where you want to quickly upload/re-upload the same file with the same metadata.

Would that solve your problem as well?  (I'm trying to kill two birds with one stone here...)



Coordinator
Jun 12, 2008 at 1:22 PM
Edited Jun 15, 2008 at 8:38 PM
Ah ok - well in that case I'll add the feature to the Edit Metadata box as you described.  Look for this in the next release.

(update) Added this as a workitem:  http://www.codeplex.com/spaceblock/WorkItem/View.aspx?WorkItemId=2326
Jun 19, 2008 at 6:10 PM
Does anyone know if there a way to set the Expires and Cache-Control headers after the file is uploaded?
Coordinator
Jun 21, 2008 at 12:45 PM
Not at the moment- I have an "Edit Metadata" feature (which would leverage S3's beta COPY support) on the internal todo list.  Are you wanting to modify the metadata for several files at once?  Or one at a time?
Jun 25, 2008 at 7:46 PM
I would want to set several files at once (including files in subdirectories).  To ensure that the Expires is set to a future date.