{"_id":"s3-proxy","_rev":"10-6e3ad203273df59661c3004a6e561b35","name":"s3-proxy","description":"Streaming http proxy Express middleware for fetching objects from S3","dist-tags":{"latest":"1.2.1"},"versions":{"1.0.0":{"name":"s3-proxy","version":"1.0.0","description":"4front plugin to proxy fetching objects from S3","main":"index.js","scripts":{"test":"mocha --reporter spec --bail --check-leaks test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"repository":{"type":"git","url":"git+https://github.com/4front/s3-proxy.git"},"keywords":["express","middleware","aws","s3","proxy"],"files":["index.js","lib"],"author":{"name":"David Von Lehman","url":"https://github.com/dvonlehman"},"license":"Apache-2.0","homepage":"https://github.com/4front/s3-proxy","dependencies":{"async":"^1.4.0","aws-config":"^1.0.3","aws-sdk":"^2.1.47","body-parser":"^1.14.1","csvtojson":"^0.4.3","debug":"^2.2.0","https-proxy-agent":"^1.0.0","lodash":"^3.10.1","mime":"^1.3.4","simple-errors":"^1.0.1","url-join":"0.0.1"},"devDependencies":{"cookie-parser":"^1.4.0","dash-assert":"^1.0.3","eslint":"^1.6.0","eslint-config-4front":"^1.0.1","express":"^4.11.1","istanbul":"^0.3.5","mocha":"^2.3.3","shortid":"^2.1.3","sinon":"^1.16.1","supertest":"^1.1.0"},"gitHead":"021355dc2bcfe69e0d57082d6340402bfbb6bfcf","bugs":{"url":"https://github.com/4front/s3-proxy/issues"},"_id":"s3-proxy@1.0.0","_shasum":"820c9b51bdae4f3e8002975b4f6867626e5ac567","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.0","_npmUser":{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},"dist":{"shasum":"820c9b51bdae4f3e8002975b4f6867626e5ac567","tarball":"https://registry.npmjs.org/s3-proxy/-/s3-proxy-1.0.0.tgz","integrity":"sha512-TbxG5krLrpph3GnM2zGmULTLtTcuy17iUhVLVOpOtwvyVwV1WUAhFSEwis7ekTsvhYXxNqww5azeRG5xw14/Ng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQN8RChfGY10rr8LSRaCBwtF8PBQGC8UQ3685kcX5aMAIhAP3P+XzrvvBxPt1RasC1+XiBgxIo1/JB1rWz0WeiH8zR"}]},"maintainers":[{"name":"dvonlehman","email":"david.vonlehman@gmail.com"}],"directories":{}},"1.0.1":{"name":"s3-proxy","version":"1.0.1","description":"Streaming http proxy Express middleware for fetching bjects from S3","main":"index.js","scripts":{"test":"mocha --reporter spec --bail --check-leaks test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"repository":{"type":"git","url":"git+https://github.com/4front/s3-proxy.git"},"keywords":["express","middleware","aws","s3","proxy"],"files":["index.js","lib"],"author":{"name":"David Von Lehman","url":"https://github.com/dvonlehman"},"license":"Apache-2.0","homepage":"https://github.com/4front/s3-proxy","dependencies":{"async":"^1.4.0","aws-config":"^1.0.3","aws-sdk":"^2.1.47","body-parser":"^1.14.1","csvtojson":"^0.4.3","debug":"^2.2.0","https-proxy-agent":"^1.0.0","lodash":"^3.10.1","mime":"^1.3.4","simple-errors":"^1.0.1","url-join":"0.0.1"},"devDependencies":{"cookie-parser":"^1.4.0","dash-assert":"^1.0.3","eslint":"^1.6.0","eslint-config-4front":"^1.0.1","express":"^4.11.1","istanbul":"^0.3.5","mocha":"^2.3.3","shortid":"^2.1.3","sinon":"^1.16.1","supertest":"^1.1.0"},"gitHead":"b50ed96d51ba80c5f2de6c81a48ff291e573acc6","bugs":{"url":"https://github.com/4front/s3-proxy/issues"},"_id":"s3-proxy@1.0.1","_shasum":"0adadc726999ef6a203b01e3144ab76170e17334","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.0","_npmUser":{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},"dist":{"shasum":"0adadc726999ef6a203b01e3144ab76170e17334","tarball":"https://registry.npmjs.org/s3-proxy/-/s3-proxy-1.0.1.tgz","integrity":"sha512-iku1qPi360ai6PeaLevW8gy7saAtpGkcVyNXFarW8CgcujQO3OcUBiOQwW9w7TcuGqLIu4sgAQ1/6i2Xm9y99g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID4lhDQyTAIRsYtSKxMqeSBYkpHWXU84WGOj+U1KjdE7AiEAqDEbMmNLFtorTteR+c0eO5ZrRV7FDfkQBTZvej94OEU="}]},"maintainers":[{"name":"dvonlehman","email":"david.vonlehman@gmail.com"}],"directories":{}},"1.0.2":{"name":"s3-proxy","version":"1.0.2","description":"Streaming http proxy Express middleware for fetching bjects from S3","main":"index.js","scripts":{"test":"mocha --reporter spec --bail --check-leaks test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"repository":{"type":"git","url":"git+https://github.com/4front/s3-proxy.git"},"keywords":["express","middleware","aws","s3","proxy"],"files":["index.js","lib"],"author":{"name":"David Von Lehman","url":"https://github.com/dvonlehman"},"license":"Apache-2.0","homepage":"https://github.com/4front/s3-proxy","dependencies":{"async":"^1.4.0","aws-config":"^1.0.3","aws-sdk":"^2.1.47","debug":"^2.2.0","lodash":"^3.10.1","mime":"^1.3.4","simple-errors":"^1.0.1","url-join":"0.0.1"},"devDependencies":{"cookie-parser":"^1.4.0","dash-assert":"^1.0.3","eslint":"^1.6.0","eslint-config-4front":"^1.0.1","express":"^4.11.1","istanbul":"^0.3.5","mocha":"^2.3.3","shortid":"^2.1.3","sinon":"^1.16.1","supertest":"^1.1.0"},"gitHead":"1fb661ef79c44d4e563b2e4e81cf6e15109ef0fe","bugs":{"url":"https://github.com/4front/s3-proxy/issues"},"_id":"s3-proxy@1.0.2","_shasum":"69fd63b0fe46fbadd5ff736a00db34644f6e7eb0","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.0","_npmUser":{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},"dist":{"shasum":"69fd63b0fe46fbadd5ff736a00db34644f6e7eb0","tarball":"https://registry.npmjs.org/s3-proxy/-/s3-proxy-1.0.2.tgz","integrity":"sha512-tllMqFBnxqC8ewITrgNvG67uKTEDdlaCBrHLXTO2s+LEnDPf53xnMlBjnvpGEadjSKnLXsT98gofllMrfUqwTw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBbrpop5jA1Y564QqbDdNJOirFS7bzHiiG3LNWJ9UV/wAiEA7myPoY1OhLjFIYzXXg93uglHDqUcSh4pW0W6xsPOwsE="}]},"maintainers":[{"name":"dvonlehman","email":"david.vonlehman@gmail.com"}],"directories":{}},"1.0.3":{"name":"s3-proxy","version":"1.0.3","description":"Streaming http proxy Express middleware for fetching objects from S3","main":"index.js","scripts":{"test":"mocha --reporter spec --bail --check-leaks test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"repository":{"type":"git","url":"git+https://github.com/4front/s3-proxy.git"},"keywords":["express","middleware","aws","s3","proxy"],"files":["index.js","lib"],"author":{"name":"David Von Lehman","url":"https://github.com/dvonlehman"},"license":"Apache-2.0","homepage":"https://github.com/4front/s3-proxy","dependencies":{"async":"^1.4.0","aws-config":"^1.0.3","aws-sdk":"^2.1.47","debug":"^2.2.0","lodash":"^3.10.1","mime":"^1.3.4","simple-errors":"^1.0.1","url-join":"0.0.1"},"devDependencies":{"cookie-parser":"^1.4.0","dash-assert":"^1.0.3","eslint":"^1.6.0","eslint-config-4front":"^1.0.1","express":"^4.11.1","istanbul":"^0.3.5","mocha":"^2.3.3","shortid":"^2.1.3","sinon":"^1.16.1","supertest":"^1.1.0"},"gitHead":"7ba1397a619cc8a27cf38d7efc8092368c8a13dc","bugs":{"url":"https://github.com/4front/s3-proxy/issues"},"_id":"s3-proxy@1.0.3","_shasum":"e881015e2f33cf1d040316920578d208c50c1379","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.0","_npmUser":{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},"dist":{"shasum":"e881015e2f33cf1d040316920578d208c50c1379","tarball":"https://registry.npmjs.org/s3-proxy/-/s3-proxy-1.0.3.tgz","integrity":"sha512-dn6tMQXzz4r/1mZ7sx6gOJelA51pC+Ll1r6wyLaIawBosiTYQcK6HVqaxMbsyorV2uQWE8W9P4E1y4Sfw3L9ow==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICak1iF0svCeGC3pWP9CEjDFJcjU/G4xl5pe2zE9zOIZAiA/dvfjef7JZHh3WkQZXHa/MWcm0d/LDoSEk9fq3zVHtQ=="}]},"maintainers":[{"name":"dvonlehman","email":"david.vonlehman@gmail.com"}],"directories":{}},"1.1.0":{"name":"s3-proxy","version":"1.1.0","description":"Streaming http proxy Express middleware for fetching objects from S3","main":"index.js","scripts":{"test":"mocha --reporter spec --bail --check-leaks test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"repository":{"type":"git","url":"git+https://github.com/dvonlehman/s3-proxy.git"},"keywords":["express","middleware","aws","s3","proxy"],"files":["index.js","lib"],"author":{"name":"David Von Lehman","url":"https://github.com/dvonlehman"},"license":"Apache-2.0","homepage":"https://github.com/dvonlehman/s3-proxy","dependencies":{"async":"^2.0.0-rc.3","aws-config":"^1.0.7","aws-sdk":"^2.3.3","base64-stream":"^0.1.3","debug":"^2.2.0","lodash.assign":"^4.0.9","lodash.isempty":"^4.2.1","lodash.map":"^4.4.0","lodash.pick":"^4.2.1","lodash.reject":"^4.4.0","lodash.trim":"^4.4.0","mime":"^1.3.4","simple-errors":"^1.0.1","url-join":"1.1.0"},"devDependencies":{"cookie-parser":"^1.4.1","dash-assert":"^1.1.0","eslint":"^2.8.0","eslint-config-4front":"^1.1.5","express":"^4.13.4","istanbul":"^0.4.3","mocha":"^2.4.5","shortid":"^2.2.6","sinon":"^1.17.3","supertest":"^1.2.0"},"gitHead":"90a114af78e5b44645f3b9778fec3e6f170f70ef","bugs":{"url":"https://github.com/dvonlehman/s3-proxy/issues"},"_id":"s3-proxy@1.1.0","_shasum":"e99f9470d708130d9e1ebc987a208b39cc380108","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},"dist":{"shasum":"e99f9470d708130d9e1ebc987a208b39cc380108","tarball":"https://registry.npmjs.org/s3-proxy/-/s3-proxy-1.1.0.tgz","integrity":"sha512-GHcZ7D/SstxQoZ8HD20AOP7QzBK+dAjjxQzu4n0xGSgQUqLhlJM3j56L0vf8wIS4DsKI6AmVb1d/HfJb2Esv9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhef2hKNSEiAw7cFPRu3P8M0l3vxB4p+amlV+rEKRhCQIhAJJGyZBZFZ0ucNsPC74Yej2Rt83eNTLVvKur9Bos8npV"}]},"maintainers":[{"name":"dvonlehman","email":"david.vonlehman@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/s3-proxy-1.1.0.tgz_1476893768356_0.9325458623934537"},"directories":{}},"1.1.1":{"name":"s3-proxy","version":"1.1.1","description":"Streaming http proxy Express middleware for fetching objects from S3","main":"index.js","scripts":{"test":"mocha --reporter spec --bail --check-leaks test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"repository":{"type":"git","url":"git+https://github.com/dvonlehman/s3-proxy.git"},"keywords":["express","middleware","aws","s3","proxy"],"files":["index.js","lib"],"author":{"name":"David Von Lehman","url":"https://github.com/dvonlehman"},"license":"Apache-2.0","homepage":"https://github.com/dvonlehman/s3-proxy","dependencies":{"async":"^2.0.0-rc.3","aws-config":"^1.0.7","aws-sdk":"^2.3.3","base64-stream":"^0.1.3","debug":"^2.2.0","lodash.assign":"^4.0.9","lodash.isempty":"^4.2.1","lodash.map":"^4.4.0","lodash.pick":"^4.2.1","lodash.reject":"^4.4.0","lodash.trim":"^4.4.0","mime":"^1.3.4","simple-errors":"^1.0.1","url-join":"1.1.0"},"devDependencies":{"cookie-parser":"^1.4.1","dash-assert":"^1.1.0","express":"^4.13.4","istanbul":"^0.4.3","mocha":"^2.4.5","shortid":"^2.2.6","sinon":"^1.17.3","supertest":"^1.2.0"},"gitHead":"00e5e86a377124ce6bfac402ee446453ca6a36f7","bugs":{"url":"https://github.com/dvonlehman/s3-proxy/issues"},"_id":"s3-proxy@1.1.1","_npmVersion":"5.5.1","_nodeVersion":"6.9.5","_npmUser":{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},"dist":{"integrity":"sha512-ie2W61FD0quLAifqJV0yc8JoyMRzanhVQ6xvCqf72kp0eTBzkSeJdXpvLlyPi0rNrPWxBsqR3TFvCgFwLtEUoQ==","shasum":"5c93dcfe2da4e525ecfa94a1af8e8ef2cc750f40","tarball":"https://registry.npmjs.org/s3-proxy/-/s3-proxy-1.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEdQfTHUiyrjEuLwKq274G7uhEmxzEEgBAa1Rnfd1zMdAiB38o1t8OPhinVD1RLKI5muYtKpgWInprTyIp7C1RwInA=="}]},"maintainers":[{"name":"dvonlehman","email":"david.vonlehman@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s3-proxy-1.1.1.tgz_1510876872817_0.5437997761182487"},"directories":{}},"1.2.1":{"name":"s3-proxy","version":"1.2.1","description":"Streaming http proxy Express middleware for fetching objects from S3","main":"index.js","scripts":{"test":"mocha --reporter spec --bail --check-leaks test/","test-cov":"istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/","test-travis":"istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"},"repository":{"type":"git","url":"git+https://github.com/dvonlehman/s3-proxy.git"},"keywords":["express","middleware","aws","s3","proxy"],"author":{"name":"David Von Lehman","url":"https://github.com/dvonlehman"},"license":"Apache-2.0","homepage":"https://github.com/dvonlehman/s3-proxy","dependencies":{"async":"^2.0.0-rc.3","aws-config":"^1.0.7","aws-sdk":"^2.3.3","base64-stream":"^0.1.3","debug":"^2.2.0","lodash.assign":"^4.0.9","lodash.isempty":"^4.2.1","lodash.map":"^4.4.0","lodash.pick":"^4.2.1","lodash.reject":"^4.4.0","lodash.trim":"^4.4.0","mime":"^1.3.4","simple-errors":"^1.0.1","url-join":"1.1.0"},"devDependencies":{"cookie-parser":"^1.4.1","dash-assert":"^1.1.0","express":"^4.13.4","istanbul":"^0.4.3","mocha":"^2.4.5","shortid":"^2.2.6","sinon":"^1.17.3","supertest":"^1.2.0"},"gitHead":"4215397515a31340e406d1c49403a9a3ace26d3a","bugs":{"url":"https://github.com/dvonlehman/s3-proxy/issues"},"_id":"s3-proxy@1.2.1","_nodeVersion":"10.13.0","_npmVersion":"6.9.0","_npmUser":{"name":"dvonlehman","email":"david.vonlehman@gmail.com"},"dist":{"integrity":"sha512-c44mStD7PMMimngIgL9fH9fmO9vIkQiIcn2BGGFF5WyDvt1gL8MYHf6CD82XX6Cf3DhR0NnVRJHsxgpMylJpuA==","shasum":"96310549efba36da10fe2981ebc2f52abdce0c1b","tarball":"https://registry.npmjs.org/s3-proxy/-/s3-proxy-1.2.1.tgz","fileCount":4,"unpackedSize":12593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdA9nSCRA9TVsSAnZWagAAZ9cP/283EpOtIg0/LHH4oFw9\nolW3oiKOdguG0LScEohCi0WrBhq+ZYtX89cOInf8aKWU08juap9GZHZ9HuWA\nUrPXPhu9nUejZAB2oncK2v+M78cWoUwvPfm7kBiTddDPrdBr+VLZomxZYGfi\neZe3xmVN0k+piQPwBTP0VKw3Dr5/4GZIX1RCEOf0BrSmBLjxG/+AUjsracJw\nJhdhzimN6BS1kVVGeRNqFljkwx3C1N29DGwOHcTkShxeZRLeTjydsQMbjNMK\nKq2QHVsVrcHtCE3LroSAPiaBbPU19iDpEReezY8sD6iuvjWx1qBNei5FF1sc\n2kGIzLyhaQESgF4YJVELpt/vJoAVhnz37NuSOqi1Q5eykdR4hMKok8N/XXEF\nndlVWXqyFLKaWSkKI0bCE3vlbNr4DEMAqU69KjXYnPpCeHAuFGphgoiqGZcM\ngk4SnXr0O99tNaM/vz0ptSlkZGuKeWNmxxq4DKKVMhOMOon9BnVBgN4BZjbf\n5cjHuzbW9gp9yiFFnFgSr/4oVFQN2bzfyyukjw5jKycrl0jxLzrrrZGFwGO8\nrfjcODuvIffLHtWQdJJ9Dt5McXEfs2NvJd7/kfvQTF38slmQiP/hPLgTBXCR\nx/QpBYUjqmqanQkna/lxSbdU8gTb30gN03oRz8so5oy5R4Im9hNIS8EEwT3I\nHiWo\r\n=Qq+d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDI59AGma9fc2kPO6HnzM/OzSVHTubo9DTzNH7AF11UsQIhAOWemak/ncFmXrJGQwX2iwiOsemsiVCFrIBYjv9XGC3+"}]},"maintainers":[{"name":"dvonlehman","email":"david.vonlehman@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s3-proxy_1.2.1_1560533457821_0.7597337633737513"},"_hasShrinkwrap":false}},"readme":"# s3-proxy\n\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nS3 proxy middleware for returning S3 objects Express apps. Useful for streaming media files and data files from S3 without having to configure web hosting on the entire origin bucket. You can explicitly override the cache headers of the underlying S3 objects.\n\n## Usage\n\n~~~js\nimport express from 'express';\nimport s3Proxy from 's3-proxy';\n\nconst app = express();\napp.get('/media/*', s3Proxy({\n  bucket: 'bucket_name',\n  prefix: 'optional_s3_path_prefix',\n  accessKeyId: 'aws_access_key_id',\n  secretAccessKey: 'aws_secret_access_key',\n  overrideCacheControl: 'max-age=100000',\n  defaultKey: 'index.html'\n}));\n~~~\n\n### Options\n\n__`accessKeyId`__\n\nThe AWS access key of the IAM user to connect to S3 with  (environment variable recommended).\n\n__`secretAccessKey`__\n\nThe AWS secret access key (environment variable recommended).\n\n__`region`__\n\nThe AWS region of the bucket, i.e. \"us-west-2\".\n\n__`bucket`__\n\nThe name of the S3 bucket.\n\n__`prefix`__\n\nOptional path to the root S3 folder where the files to be hosted live. If omitted, the http requests to the proxy need to mirror the full S3 path.\n\n__`defaultCacheControl`__\n\nValue of the `Cache-Control` header to use if the metadata from the S3 object does not specify it's own value.\n\n__`overrideCacheControl`__\n\nValue of the `Cache-Control` header that is applied to the response even if there there is a different value on the S3 object metadata.\n\n__`defaultKey`__\n\nIf a call is made to a url ending in `/`, and this option is present its value is used as the s3 key name. For example, you may wish to allow users to access `/index.html` when calling `/` on a route. \n\n\n### HTTP Cache Headers\n\nThe `s3-proxy` provides two different caching mechanisms. First you can specify either the `defaultCacheControl` or `overrideCacheControl` options to control the `Cache-Control` header that is sent in the proxied response. The most optimal policy is to specify a `max-age=seconds` value that informs the browser and any intermediary CDN and network proxies to cache the response for the specified number of seconds and not return to the origin server until that time has elapsed.\n\nSecondly it supports the `ETag` value that S3 automatically creates whenever an object is written. The proxy forwards this header along in the http response. If the value of an incoming `If-None-Match` request header matches the `ETag` of the S3 object, the proxy returns an empty `304 Not Modified` response. This is known as a \"conditional get\" request.\n\nFor a more in-depth description of the different caching headers and techniques, see the [Google Developer HTTP caching documentation](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching?hl=en).\n\n## Example\n\nLet's assume there is a bucket \"mycompany-media-assets\". Within this bucket is a folder named \"website\" where the images, videos, etc. for the company website reside.\n\n~~~sh\nmycompany-media-assets\n└── website\n    └── images\n        ├── logo.png\n        └── background.jpg\n~~~\n\nThe corresponding s3-proxy route definition would look something like below. The `Cache-Control` response header will be set to have a max age of 30 days (2592000 seconds) no matter what metadata exists on the corresponding S3 object. This means whatever tool is being used to write the files to S3 need not worry about configuring proper cache metadata, the proxy will take care of that.\n\n~~~js\napp.get('/media/*', s3Proxy({\n  bucket: 'mycompany-media-assets',\n  prefix: 'website',\n  accessKeyId: 'aws_access_key_id',\n  secretAccessKey: 'aws_secret_access_key',\n  overrideCacheControl: 'max-age=2592000'\n}));\n~~~\n\nNow images can be declared in views like so:\n\n~~~html\n<img src=\"/media/images/logo.png\"/>\n~~~\n\n### Listing objects\nIt's also possible to return a JSON listing of all the keys by making a request ending with a trailing slash. For the sample above, issuing a request to `/media/images/` will return: `['logo.png', 'background.jpg']`. This is the default behavior when `defaultKey` is false.\n\n### Default Key \nIf you don't need list objects when making requests ending in a trailing slash, you can instead use a default s3 key by setting the parameter `defaultKey` in options. For example, if `defaultKey` is set to `index.html`, calls to urls like `/media` will return to object `/media/index.html`. \n\n## License\nLicensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\n[travis-image]: https://img.shields.io/travis/4front/s3-proxy.svg?style=flat\n[travis-url]: https://travis-ci.org/4front/s3-proxy\n[coveralls-image]: https://img.shields.io/coveralls/4front/s3-proxy.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/4front/s3-proxy?branch=master\n","maintainers":[{"name":"dvonlehman","email":"david.vonlehman@gmail.com"}],"time":{"modified":"2022-06-26T15:12:03.550Z","created":"2015-11-16T20:33:41.405Z","1.0.0":"2015-11-16T20:33:41.405Z","1.0.1":"2015-11-16T20:36:16.901Z","1.0.2":"2015-11-16T20:47:54.059Z","1.0.3":"2015-11-16T21:14:18.576Z","1.1.0":"2016-10-19T16:16:08.574Z","1.1.1":"2017-11-17T00:01:12.881Z","1.2.1":"2019-06-14T17:30:57.981Z"},"homepage":"https://github.com/dvonlehman/s3-proxy","keywords":["express","middleware","aws","s3","proxy"],"repository":{"type":"git","url":"git+https://github.com/dvonlehman/s3-proxy.git"},"author":{"name":"David Von Lehman","url":"https://github.com/dvonlehman"},"bugs":{"url":"https://github.com/dvonlehman/s3-proxy/issues"},"license":"Apache-2.0","readmeFilename":"README.md"}