Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable gzip + cache-control on CDN #1523

Merged
merged 1 commit into from
Jun 10, 2018
Merged

Enable gzip + cache-control on CDN #1523

merged 1 commit into from
Jun 10, 2018

Conversation

jeffposnick
Copy link
Contributor

R: @philipwalton

Fixes #1412

It took a little bit of experimentation with a test project, but based on those results, this code is sufficient to enable both gzip compression and the Cache-Control header.

(Let's obviously pay close attention to the CDN uploads right after our next release.)

@jeffposnick jeffposnick requested a review from philipwalton June 10, 2018 18:39
Copy link
Member

@philipwalton philipwalton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! Great to have this working.

public: true,
resumable: false,
metadata: {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This double metadata is weird, but required...

@workbox-pr-bot
Copy link
Collaborator

PR-Bot Size Plugin

Changed File Sizes

No file sizes have changed.

New Files

No new files have been added.

All File Sizes

View Table
File Before After Change GZipped
packages/workbox-background-sync/build/workbox-background-sync.prod.js 3.51 KB 3.51 KB 0% 1.45 KB
packages/workbox-broadcast-cache-update/build/workbox-broadcast-cache-update.prod.js 1.12 KB 1.12 KB 0% 584 B
packages/workbox-build/build/_types.js 41 B 41 B 0% 61 B
packages/workbox-build/build/index.js 4.02 KB 4.02 KB 0% 1.57 KB
packages/workbox-cache-expiration/build/workbox-cache-expiration.prod.js 3.78 KB 3.78 KB 0% 1.33 KB
packages/workbox-cacheable-response/build/workbox-cacheable-response.prod.js 587 B 587 B 0% 345 B
packages/workbox-cli/build/app.js 6.50 KB 6.50 KB 0% 2.16 KB
packages/workbox-cli/build/bin.js 2.32 KB 2.32 KB 0% 1.03 KB
packages/workbox-core/build/workbox-core.prod.js 6.86 KB 6.86 KB 0% 2.73 KB
packages/workbox-google-analytics/build/workbox-google-analytics.prod.js 2.12 KB 2.12 KB 0% 1.03 KB
packages/workbox-precaching/build/workbox-precaching.prod.js 5.68 KB 5.68 KB 0% 2.16 KB
packages/workbox-range-requests/build/workbox-range-requests.prod.js 1.63 KB 1.63 KB 0% 797 B
packages/workbox-routing/build/workbox-routing.prod.js 2.87 KB 2.87 KB 0% 1.31 KB
packages/workbox-strategies/build/workbox-strategies.prod.js 4.30 KB 4.30 KB 0% 1.14 KB
packages/workbox-streams/build/workbox-streams.prod.js 1.66 KB 1.66 KB 0% 765 B
packages/workbox-sw/build/workbox-sw.js 1.47 KB 1.47 KB 0% 792 B
packages/workbox-webpack-plugin/build/generate-sw.js 8.04 KB 8.04 KB 0% 2.57 KB
packages/workbox-webpack-plugin/build/index.js 742 B 742 B 0% 470 B
packages/workbox-webpack-plugin/build/inject-manifest.js 10.30 KB 10.30 KB 0% 3.23 KB

Workbox Aggregate Size Plugin

9.57KB gzip'ed (64% of limit)
24.93KB uncompressed

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.733% when pulling 7ed2f83 on gzip-cdn into f1dc3d8 on master.

@jeffposnick jeffposnick merged commit c04f355 into master Jun 10, 2018
@jeffposnick jeffposnick deleted the gzip-cdn branch June 10, 2018 18:57
@CTassisF
Copy link

Looks like that (at least) the cache-control part of this PR didn't work properly:

$ lynx -head -source https://storage.googleapis.com/workbox-cdn/releases/3.3.0/workbox-sw.js | grep -i Cache-Control
x-goog-meta-Cache-Control: max-age=31536000
Cache-Control: public, max-age=3600

@jeffposnick
Copy link
Contributor Author

#1539 will hopefully do the trick.

(I swore that code worked for me when testing against another Cloud Storage bucket...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check HTTP serving setup on CDN copies
5 participants