Skip to content

Commit

Permalink
Disable S3 Cache during the deployment (#280)
Browse files Browse the repository at this point in the history
* Disable S3 Cache during the deployment

* Keep cache default maxage and add must-revalidate and s-maxage directives

* Shorten the cache time

* Change s-maxage directive value to 7 days

---------

Co-authored-by: Abdelhak Marouane <[email protected]>
  • Loading branch information
amarouane-ABDELHAK and Abdelhak Marouane authored Feb 12, 2024
1 parent a98ab46 commit c5b81e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ jobs:

- name: Deploy to S3 Production
run: |
aws s3 sync ./dist s3://${{ secrets.S3_BUCKET }}${{ vars.SUBPATH }} --cache-control max-age=604800 --delete
aws s3 sync ./dist s3://${{ secrets.S3_BUCKET }}${{ vars.SUBPATH }} --cache-control max-age=30,must-revalidate,s-maxage=604800 --delete
- name: Request Invalidation to AWS Cloudfront
uses: oneyedev/aws-cloudfront-invalidation@v1
with:
Expand Down

0 comments on commit c5b81e3

Please sign in to comment.