Giter VIP home page Giter VIP logo

Comments (2)

lericson avatar lericson commented on August 11, 2024

This is not what the metadata argument is for, try headers. Closes #13

Sent from phone

Anders Ytterström [email protected] wrote:

I am trying to set some far future expiration on my files in a bucket on S3, using this python code:

future = 60_60_24*666
future_date = datetime.now() + timedelta(seconds=future)
future_date = future_date.strftime("%a, %d %b %Y %H:%M:%S GMT")

and further down in file:

f = open(src)
s3.put(key, f.read())

s3.copy("%s/%s" % (bucket, key), key, metadata={
"Cache-control": "max-age=%d" % future,
"Expires": future_date})

However, when I investigate the files in firebug they do not have neither Expires och Cache-control. Instead there are prefixed versions of the metadata.

x-amz-meta-cache-control max-age=57542400
x-amz-meta-expires Thu, 15 May 2014 01:03:25 GMT

I would highly appreciate to set metadata and skip the "-x-amz-" prefixes.


Reply to this email directly or view it on GitHub:
#13

from simples3.

madr avatar madr commented on August 11, 2024

Ah, my bad. I missed headers when reading the docs. Thank you for the quick reply!

from simples3.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.