I’m generating a static webpage from markdown using Pelican. Then, I upload the output to S3 using s3cmd:
s3cmd sync -rr --delete-removed output/ s3://mybucket/
Unfortunately, the metadata for the css files are set wrong, I’ve to set them manualy to “text/css”. Is there a way to make s3cmd to set them (and maybe other filetypes to) to a correct value? Or if not, is there a alternative to s3cmd which runs on Linux and MacOS X?
You can set the mime-type of a file while uploading to s3 by using the -m switch
Additionally, what I do, is compress it with gzip first, then upload to s3, but you have to set the content encoding as well. Note that Chrome and Safari sometimes don’t like the .gz extension so i use .jgz.
Also note that in the html file that links to this css, you should check that the browser can handle a gzip. Here is a sample in php: