{"id":15348168,"url":"https://github.com/ironcore864/lambda-s3-cache-control-headers","last_synced_at":"2025-08-14T11:37:41.898Z","repository":{"id":73865937,"uuid":"216774499","full_name":"IronCore864/lambda-s3-cache-control-headers","owner":"IronCore864","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-22T09:28:12.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-31T12:46:25.565Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IronCore864.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-22T09:27:28.000Z","updated_at":"2019-10-22T09:28:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"7a29cbdc-d36d-4493-bb5b-3918972465fb","html_url":"https://github.com/IronCore864/lambda-s3-cache-control-headers","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"efe2c20889f05992ed0496e93b09bc2d3dde663b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCore864%2Flambda-s3-cache-control-headers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCore864%2Flambda-s3-cache-control-headers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCore864%2Flambda-s3-cache-control-headers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCore864%2Flambda-s3-cache-control-headers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IronCore864","download_url":"https://codeload.github.com/IronCore864/lambda-s3-cache-control-headers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239898461,"owners_count":19715212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T11:45:12.879Z","updated_at":"2025-02-20T19:17:29.189Z","avatar_url":"https://github.com/IronCore864.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Set Cache Control Headers on S3 Origin\n\nIntegrate S3 event with this lambda function and it will set Cache-Control max-age headers for each file created/updated in the S3 bucket.\n\nIn this case you don't need to use default TTL in CloudFront, but rather use origin settings.\n\n## Dependency\n\n- python3\n- venv\n\n## Build\n \n```\n# at the root directory of this repo\nvirtualenv venv\n. ./venv/bin/activate\npip3 install -r requirements.txt\nrm ~/set_cache_control.zip\ncd venv/lib/python3.7/site-packages  \nzip -r ~/set_cache_control.zip .\ncd -\nzip -g ~/set_cache_control.zip main.py\n```\n\nUpload to s3, and publish new version of lambda:\n\n```\naws s3 cp ~/set_cache_control.zip s3://your-bucket-for-lambda-package/\naws lambda update-function-code --s3-bucket your-bucket-for-lambda-package --s3-key set_cache_control.zip --function-name your_lambda_function_name\naws lambda publish-version --function-name your_lambda_function_name\n```\n\n## TEST\n```\npython -m unittest discover test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironcore864%2Flambda-s3-cache-control-headers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fironcore864%2Flambda-s3-cache-control-headers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironcore864%2Flambda-s3-cache-control-headers/lists"}