Amazon S3 HTTP Headers and Object Metadata: Content-Type, Cache-Control and Custom Headers
CS Browser
Free Windows client for Amazon S3 and Amazon S3 compatible storage services
 
Follow

Working with Amazon S3 HTTP Headers and Metadata

HTTP Headers and Object Metadata Overview

HTTP headers describe a file stored in Amazon S3 and tell browsers and other clients how to handle it. For example, Content-Type identifies the file format, Cache-Control controls caching, and Content-Disposition can suggest downloading a file instead of displaying it.

In CS Browser, select a file and open the Headers tab to view its HTTP headers and user-defined metadata. Headers marked Yes in the Read-only column, such as Content-Length, ETag and Last-Modified, are managed by the storage service and cannot be edited directly.

Changes are not sent to Amazon S3 until you click Apply changes on the Headers tab. Saving the Add or Edit dialog only updates the list of headers in CS Browser.

Updating metadata on an existing object uses a server-side copy to the same object key. The file does not need to be downloaded and uploaded again. In a versioning-enabled bucket, this creates a new object version. Your account needs permission to read and write the object; additional permissions may be needed for encrypted objects. See AWS documentation on editing object metadata.

How to Add an HTTP Header

  1. Select the file in your bucket and open the Headers tab.

    Amazon S3 object headers with the Add button highlighted
    Open the Headers tab and click Add.
  2. Click Add to open the Add New HTTP Header dialog.

    Add New HTTP Header dialog with Cache-Control set to max-age=3600
    Enter the header name and value, then click Add new http header.
  3. Fill in the two fields:

    • Header name - enter a standard header such as Cache-Control, or a custom metadata name starting with x-amz-meta-.
    • Header value - enter the value, for example max-age=3600. For Expires, use the date and time picker.

    Enter the name and value separately, without a colon after the name. Both fields are required. Suggestions are available for common names and values.

  4. Click Add new http header, review the list, then click Apply changes on the Headers tab.

How to Edit an HTTP Header

  1. Select the file and open the Headers tab.

  2. Select an editable header and click Edit to open the Edit HTTP Header dialog.

    Cache-Control selected on the Headers tab with Edit highlighted
    Select the header you want to change and click Edit.
  3. Update the Header value and click Save changes.

    Edit HTTP Header dialog with Cache-Control changed to max-age=86400
    Change the header value and click Save changes.
  4. Click Apply changes on the Headers tab to save the updated metadata to Amazon S3.

    Updated Cache-Control value on the Headers tab with Apply changes highlighted
    Click Apply changes to save the updated headers to Amazon S3.

To discard unsaved changes for the selected file, click Reload on the Headers tab. This retrieves the current headers from the storage service.

How to Delete HTTP Headers

  1. Select a single file and open the Headers tab.

  2. Select one or more editable headers and click Delete.

    Custom x-amz-meta-project metadata selected with the Delete button highlighted
    Select the metadata entry and click Delete, then Apply changes.
  3. Click Apply changes. This removes the selected metadata entries, not the file itself. Some standard headers may be supplied by the storage service even if you do not set them explicitly.

Common Headers and Custom Metadata

  • Content-Type: application/pdf identifies a PDF document. Other examples include image/jpeg and text/html. Changing this header does not convert the file to another format.
  • Cache-Control: max-age=3600 sets a freshness lifetime of one hour. Choose a value appropriate for how often the file changes.
  • Content-Disposition: attachment asks the client to download the file. To suggest a download name, use attachment; filename="report.pdf".
  • Content-Encoding: gzip is appropriate only when the stored content is already gzip-compressed. Setting the header does not compress the file.
  • Expires: choose the expiration date and time for cached content. This header does not delete the object. For automatic deletion, use Amazon S3 Lifecycle rules.
  • Custom metadata: enter x-amz-meta-project as the name and website as the value to store an application-specific property.

Amazon S3 returns user-defined metadata names in lowercase. Use simple ASCII names and values for interoperability. Custom metadata is different from object tags, which are managed on the Tags tab. See AWS documentation on object metadata.

Apply Headers to Multiple Files

Select multiple files, open the Headers tab and add the headers you want to apply. The list is initially empty for a multiple-file selection; this does not mean that the selected files have no metadata. Click Apply changes to add or replace the specified headers while retaining other existing metadata.

When working with a folder or bucket, select Apply for all subfolders and files to include its contents. Review the selection before applying changes to many files. To remove an existing metadata entry, select the individual file and use Delete; removing an entry from the batch list does not remove that header from every selected file.

For files you upload in the future, configure Default HTTP Headers using Tools > Default HTTP Headers.

Related Materials

CS Browser 13.6.3 Freeware
Powered by Amazon Web Services and Rated by CNET Editors!
Our customers say

"CS Browser is an invaluable tool to me as a web developer to easily manage my automated site backups" -Bob Kraft, Web Developer

"Just want to show my appreciation for a wonderful product. I use CS Browser a lot, it is a great tool." -Gideon Kuijten, Pro User

"Thank You Thank You Thank You for this tool. A must have for anyone using Amazon S3!" -Brian Cummiskey, USA

Related Products
RdpGuard
protects your Windows Server from RDP Brute-force Attacks.
CS Browser is developed by Netsdk Software FZE and is not affiliated with, endorsed by, or sponsored by Amazon or AWS. Amazon S3 and Amazon S3 Glacier are trademarks of Amazon.com, Inc. or its affiliates.
Copyright © 2008-2026 Netsdk Software FZE. All rights reserved.  Terms of Use.  Privacy Policy.  Mount Amazon S3 Bucket.  RDP brute-force protection.