Tag: Http Headers

Two Ways to Setup Content Expiration with CloudBerry Explorer for Amazon S3

Two Ways to Setup Content Expiration with CloudBerry Explorer for Amazon S3

Amazon S3 browser by CloudBerry is a powerful Windows program that helps to manage all aspects of Amazon S3 storage. Many people use Amazon S3 to host their media content or entire websites to offload static content from their web servers, increase scalability or deal with so-called TechCrunch effect, when after publishing a review on a popular website such as TechCrunch the number of visitors suddenly jumps tenfold. Continue reading

How to set custom HTTP headers for Amazon S3 objects with CloudBerry Explorer

How to set custom HTTP headers for Amazon S3 objects with CloudBerry Explorer

In CloudBerry Lab we are trying to make what works best for our customers and custom HTTP headers are no exception. This is something that was brought up many times. For instance, renowned blogger Amit Agarwal brought it up in his post on CloudBerry Explorer.

Why should I care about custom HTTP headers?

If you are using Amazon S3 to serve your files over HTTP sometimes you need an additional flexibility that custom HTTP headers could provide.  For instance, if you properly set Cache-Control HTTP header, it will help you to reduce your Amazon S3 bills. For more information check out another Amit Agarwal’ post.
There are two ways you can configure HTTP headers using CloudBerry Explorer. You can set up HTTP-headers for the files already located in S3 buckets or configure them right before copying files to S3.

How to set custom HTTP header for files already stored on Amazon S3

Just select the file you want to set headers for and right click it. You will see an option called Set HTTP Headers in the context menu. The same option is available on the toolbar.
set http headers
You will get the windows with the list of HTTP headers like the one below. The list shows the headers that are already assigned to the file. Most of them are assigned by Amazon S3 by default.
http headers manager
If you want to add a custom HTTP header just click the add button and choose the header from the list. You can also type a name of the header manually if it is not there.   For our example with will set Cache-Control header.
edit http header
Then choose the value for the header from the list.  Note that the list is filled with predefined values, but you can always type in your own value.
http header value

 Click ok and the new header will appear in the list.

http headers list
Click ok once again and ok on the confirmation dialog. The header will be applied to the file on S3.  Next time someone requests this file from the web browser, the new HTTP header will take effect.

Can I set headers for multiple files at once?

Yes! Just multi-select the files that you want to set headers for and follow the instructions above.

How to set custom HTTP headers for files that I want to copy to S3

It is very easy to set custom HTTP headers to the files when they are copied to Amazon S3.  When you copy files a confirmation dialog now has Set HTTP headers link. If you click on it the same window will come up and you will be able to manage HTTP headers. Just follow the steps above.

Cache-Control and Amazon CloudFront

When you use Amazon CloudFront service Cache-Control header is becoming even more important.  CloudFront edge servers will check S3 to see if the object has changed after the expiration time you set on your object.  If you have set no expiration time on your object, the default is 24 hours.  When that check is made, if the object is S3 has changed, the new object will go into the edge location.

Looking ahead

Besides the caching, we are also looking into GZIP support that will help you to serve compressed files from S3. Not only will it help you to lower your bills but also to serve your contents faster!

Conclusion

With the ability to set custom HTTP headers CloudBerry Explorer is becoming a compelling tool for Amazon S3 users, in particular to web site developers who want to have granular control on how the files are handled by the web browser. What’s more caching is what can significantly lower your Amazon S3 monthly bills.