Skip to content

Commit c2d9d1c

Browse files
[CUTL-90] 🚀 (Circle CI Config) Do not cache sw.js and related files
1 parent 18fc674 commit c2d9d1c

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

.circleci/config.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,17 @@ jobs:
147147
name: Enable CloudFront
148148
command: aws configure set preview.cloudfront true
149149
- run:
150-
name: Upload to S3
150+
name: Upload to S3 with all cached
151151
command: aws s3 sync ./build s3://${S3_BUCKET_NAME} --delete --cache-control max-age=31536000,public
152-
153152
- run:
154-
name: Update file cache headers
153+
name: Update file cache headers to remove caching - index.html
155154
command: aws s3 cp s3://${S3_BUCKET_NAME}/index.html s3://${S3_BUCKET_NAME}/index.html --metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html --acl public-read
155+
- run:
156+
name: Update file cache headers to remove caching - sw.js
157+
command: aws s3 cp s3://${S3_BUCKET_NAME}/sw.js s3://${S3_BUCKET_NAME}/sw.js --metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html --acl public-read
158+
- run:
159+
name: Update file cache headers to remove caching - sw.js.gz
160+
command: aws s3 cp s3://${S3_BUCKET_NAME}/sw.js.gz s3://${S3_BUCKET_NAME}/sw.js.gz --metadata-directive REPLACE --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html --acl public-read
156161
- run:
157162
name: Invalidate CloudFront distribution
158163
command: aws cloudfront create-invalidation --distribution-id ${DISTRIBUTION_ID} --paths "/index.html"
@@ -176,7 +181,6 @@ jobs:
176181
name: Notify via Slack
177182
command: curl -X POST -H 'Content-type:\ application/json' --data "{'text':'🍰 Deploy successful.'}" $SLACK_HOOK
178183

179-
180184
notify-sentry-deploy:
181185
executor: docker-executor
182186
steps:
@@ -196,7 +200,6 @@ jobs:
196200
name: Notify via Slack
197201
command: curl -X POST -H 'Content-type:\ application/json' --data "{'text':'🦾 Sentry Release successful.'}" $SLACK_HOOK
198202

199-
200203
workflows:
201204
version: 2
202205
build_and_test:

babel.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
'styled-components',
99
['@babel/plugin-proposal-decorators', { legacy: true }],
1010
['@babel/plugin-proposal-class-properties', { loose: true }],
11+
['@babel/plugin-proposal-private-methods', { loose: true }],
1112
'@babel/plugin-syntax-dynamic-import',
1213
],
1314
env: {

firebase.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@
1111
"headers": [
1212
{
1313
"source": "/**",
14-
"headers": [
15-
{
16-
"key": "Cache-Control",
17-
"value": "max-age=86400"
18-
}
19-
]
14+
"headers": [{ "key": "Cache-Control", "value": "max-age=86400" }]
2015
},
2116
{
2217
"source": "/sw.js",

0 commit comments

Comments
 (0)