taskcluster / unified-logviewer

Mozilla Public License 2.0
2 stars 5 forks source link

Raise the cache max-age of static assets #27

Open edmorley opened 7 years ago

edmorley commented 7 years ago

The static assets are currently being served with a low max-age, when they could be served with something much higher:

$ curl -Is 'https://taskcluster.github.io/unified-logviewer/0c3e17772699f2385f94.worker.js'  | grep 'Cache-Control'
Cache-Control: max-age=600

Unfortunately GitHub pages doesn't provide support for this, so hosting would need to be performed elsewhere (eg Heroku).

As part of doing this, more non-html assets would need to have cache-busting filenames (ie including a hash or version string), for example: https://taskcluster.github.io/unified-logviewer/commons.js

eliperelman commented 7 years ago

I agree, and am honestly not sure why the commons chunk isn't using a hash-based filename as well.

@helfi92 this will probably need to be done inside a neutrino preset for the optimization work.

eliperelman commented 7 years ago

For reference:

https://github.com/mozilla-neutrino/neutrino-preset-web/blob/master/src/index.js#L43

helfi92 commented 7 years ago

Thanks @eliperelman for the reference. I started the migration to Webpack 2 + optimization. Work in progress :)

eliperelman commented 7 years ago

Q2 2017 I plan on making this into a proper React component in a new repo that can be imported in TaskCluster and Treeherder, so this will be at the whim of the importer.