-
Notifications
You must be signed in to change notification settings - Fork 692
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
Chore: add more media mimetypes #4169
base: main
Are you sure you want to change the base?
Conversation
74fffbc
to
c0cc65a
Compare
Also worth noting that some of these mimetypes aren't supported in all browsers; adding a check to the compat hint to ensure that these are used in backward-compatible ways (e.g. in a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Question for @webhintio/contributors, is there any audio/image/video that shouldn't have a long cache? because one solution could be to have something like |
On Mon, Dec 14, 2020 at 09:17:45AM -0800, Jesus David García Gomez wrote:
is there any audio/image/video that shouldn't have a long cache?
because one solution could be to have something like `video/*`
`image/*` `audio/*`.
Good point; I can update + force-push to do this for all audio, video,
image, and font subtypes.
…--
/Seirdy
|
I like the idea of not maintaining a granular list here since we don't need to vary behavior on specific audio/font/image/video types. Seems if there are any exceptions it'd be a shorter list to maintain that rather than listing everything to begin with. |
1783e50
to
fb9e5a5
Compare
packages/hint-http-cache/src/hint.ts
Outdated
'audio/ogg', | ||
'audio/mpeg', | ||
'audio/mp4', | ||
'audio/*', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more code is necessary to make this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does seem to fail one jsdom test:
› validateResults (/home/vsts/work/1/s/packages/utils-tests-helpers/src/hint-runner.ts:159:11)
› runHint (/home/vsts/work/1/s/packages/utils-tests-helpers/src/hint-runner.ts:418:20)
fb9e5a5
to
c0cc65a
Compare
On Thu, Dec 17, 2020 at 09:34:45AM -0800, Tony Ross wrote:
I like the idea of not maintaining a granular list here since we don't need to vary behavior on specific audio/image/video types. Seems if there are any exceptions it'd be a shorter list to maintain that rather than listing everything to begin with.
Looks like that'll be a bit more than just replacing the subtype with an
asterisk. I switched back to enumerating individual subtypes until then,
and I'll take a closer look this weekend.
Should be mergeable now. I've attached a patch to switch back if anyone
wants it.
…--
/Seirdy
From 0336c5cb9d019edcfddb322d8117fcaf6e059944 Mon Sep 17 00:00:00 2001
From: Rohan Kumar <[email protected]>
Date: Fri, 18 Dec 2020 17:34:59 -0800
Subject: [PATCH] Fix: Name specific mime subtypes in longCached
Matching all subtypes with "mime/*" causes a failure; enumerate specific
ones until tha is handled.
---
packages/hint-http-cache/src/hint.ts | 41 ++++++++++++++++++++++------
1 file changed, 33 insertions(+), 8 deletions(-)
diff --git a/packages/hint-http-cache/src/hint.ts b/packages/hint-http-cache/src/hint.ts
index 9babf405d..370a999c2 100644
--- a/packages/hint-http-cache/src/hint.ts
+++ b/packages/hint-http-cache/src/hint.ts
@@ -65,15 +65,40 @@ export default class HttpCacheHint implements IHint {
const maxAgeResource = context.hintOptions && context.hintOptions.maxAgeResource || 31536000; // 1 year
/** Resources' mediaType that should be cached for a long time.*/
const longCached = [
- 'audio/*',
- 'image/*',
- 'video/*',
-
- 'font/*',
- 'application/vnd.ms-fontobject',
- 'text/css',
'application/manifest+json',
- 'text/javascript'];
+
+ 'audio/ogg',
+ 'audio/opus',
+ 'audio/mpeg',
+ 'audio/mp4',
+ 'audio/x-flac',
+ 'audio/x-wav',
+
+ 'font/collection',
+ 'application/vnd.ms-fontobject',
+ 'font/opentype',
+ 'font/otf',
+ 'font/ttf',
+ 'font/woff',
+ 'font/woff2',
+
+ 'image/avif',
+ 'image/bmp',
+ 'image/gif',
+ 'image/jpeg',
+ 'image/jp2',
+ 'image/png',
+ 'image/svg+xml',
+ 'image/webp',
+ 'image/x-icon',
+
+ 'text/css',
+ 'text/javascript',
+
+ 'video/mp4',
+ 'video/ogg',
+ 'video/webm',
+ 'video/x-matroska'];
/** The predefined patterns for file revving.*/
const predefinedRevvingPatterns: RegExp[] = [
/*
--
2.26.2
|
Bumps [webpack](https://github.com/webpack/webpack) from 5.19.0 to 5.21.1. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](webpack/webpack@v5.19.0...v5.21.1) Signed-off-by: dependabot-preview[bot] <[email protected]>
Connectors oerview => Connectors overview - - - - - - - - - - - - - - - - - - - - Fix webhintio#4261 Close webhintio#4302
Change pathToTslib to resolve the path to tslib based on the tsconfig.json location rather than current working directory - - - - - - - - - - - - - - - - - - - - Fix webhintio#4175 Close webhintio#4258
Bumps [update-notifier](https://github.com/yeoman/update-notifier) from 5.0.1 to 5.1.0. - [Release notes](https://github.com/yeoman/update-notifier/releases) - [Commits](sindresorhus/update-notifier@v5.0.1...v5.1.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [fs-extra](https://github.com/jprichardson/node-fs-extra) from 9.0.1 to 9.1.0. - [Release notes](https://github.com/jprichardson/node-fs-extra/releases) - [Changelog](https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md) - [Commits](jprichardson/node-fs-extra@9.0.1...9.1.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [@types/chrome](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chrome) from 0.0.129 to 0.0.130. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chrome) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.1.0 to 18.1.1. - [Release notes](https://github.com/octokit/rest.js/releases) - [Commits](octokit/rest.js@v18.1.0...v18.1.1) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [util.promisify](https://github.com/ljharb/util.promisify) from 1.0.1 to 1.1.1. - [Release notes](https://github.com/ljharb/util.promisify/releases) - [Changelog](https://github.com/ljharb/util.promisify/blob/main/CHANGELOG.md) - [Commits](ljharb/util.promisify@v1.0.1...v1.1.1) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.14.2 to 4.15.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.0/packages/eslint-plugin) Signed-off-by: dependabot-preview[bot] <[email protected]>
* Fix: Webpack configuration
Bumps [file-type](https://github.com/sindresorhus/file-type) from 16.4.0 to 16.5.0. - [Release notes](https://github.com/sindresorhus/file-type/releases) - [Commits](sindresorhus/file-type@v16.4.0...v16.5.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [applicationinsights](https://github.com/microsoft/ApplicationInsights-node.js) from 2.0.0 to 2.1.1. - [Release notes](https://github.com/microsoft/ApplicationInsights-node.js/releases) - [Commits](microsoft/ApplicationInsights-node.js@2.0.0...2.1.1) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [acorn](https://github.com/acornjs/acorn) from 8.2.4 to 8.4.0. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](acornjs/acorn@8.2.4...8.4.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 5.2.4 to 5.2.6. - [Release notes](https://github.com/webpack-contrib/css-loader/releases) - [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md) - [Commits](webpack-contrib/css-loader@v5.2.4...v5.2.6) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [@typescript-eslint/typescript-estree](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-estree) from 4.26.0 to 4.26.1. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/typescript-estree/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.26.1/packages/typescript-estree) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [execa](https://github.com/sindresorhus/execa) from 5.0.0 to 5.1.1. - [Release notes](https://github.com/sindresorhus/execa/releases) - [Commits](sindresorhus/execa@v5.0.0...v5.1.1) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.7.0 to 4.7.2. - [Release notes](https://github.com/webpack/webpack-cli/releases) - [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-cli/compare/[email protected]@4.7.2) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 17.0.5 to 17.0.7. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [@types/chrome](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chrome) from 0.0.141 to 0.0.145. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chrome) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [webpack](https://github.com/webpack/webpack) from 5.38.1 to 5.39.1. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](webpack/webpack@v5.38.1...v5.39.1) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [postcss-scss](https://github.com/postcss/postcss-scss) from 3.0.5 to 4.0.0. - [Release notes](https://github.com/postcss/postcss-scss/releases) - [Changelog](https://github.com/postcss/postcss-scss/blob/main/CHANGELOG.md) - [Commits](postcss/postcss-scss@3.0.5...4.0.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [ora](https://github.com/sindresorhus/ora) from 5.4.0 to 5.4.1. - [Release notes](https://github.com/sindresorhus/ora/releases) - [Commits](sindresorhus/ora@v5.4.0...v5.4.1) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [globby](https://github.com/sindresorhus/globby) from 11.0.3 to 11.0.4. - [Release notes](https://github.com/sindresorhus/globby/releases) - [Commits](sindresorhus/globby@v11.0.3...v11.0.4) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.9 to 17.0.11. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [typed-css-modules](https://github.com/Quramy/typed-css-modules) from 0.6.8 to 0.7.0. - [Release notes](https://github.com/Quramy/typed-css-modules/releases) - [Commits](Quramy/typed-css-modules@v0.6.8...v0.7.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [ajv](https://github.com/ajv-validator/ajv) from 8.5.0 to 8.6.0. - [Release notes](https://github.com/ajv-validator/ajv/releases) - [Commits](ajv-validator/ajv@v8.5.0...v8.6.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.2 to 9.2.3. - [Release notes](https://github.com/TypeStrong/ts-loader/releases) - [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md) - [Commits](TypeStrong/ts-loader@v9.2.2...v9.2.3) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [postcss-safe-parser](https://github.com/postcss/postcss-safe-parser) from 5.0.2 to 6.0.0. - [Release notes](https://github.com/postcss/postcss-safe-parser/releases) - [Changelog](https://github.com/postcss/postcss-safe-parser/blob/main/CHANGELOG.md) - [Commits](postcss/postcss-safe-parser@5.0.2...6.0.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [eslint](https://github.com/eslint/eslint) from 7.27.0 to 7.29.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](eslint/eslint@v7.27.0...v7.29.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin) from 6.2.10 to 6.2.12. - [Release notes](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/releases) - [Changelog](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/main/CHANGELOG.md) - [Commits](TypeStrong/fork-ts-checker-webpack-plugin@v6.2.10...v6.2.12) Signed-off-by: dependabot-preview[bot] <[email protected]>
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.22.0 to 4.27.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.27.0/packages/eslint-plugin) Signed-off-by: dependabot-preview[bot] <[email protected]>
Making this match reality as we're generally prepared to help resolve issues in dependency updates about once a month (aside from higher-priority security issues). Close webhintio#4658
Bumps [@octokit/core](https://github.com/octokit/core.js) from 3.2.5 to 3.5.1. - [Release notes](https://github.com/octokit/core.js/releases) - [Commits](octokit/core.js@v3.2.5...v3.5.1) Signed-off-by: dependabot-preview[bot] <[email protected]> * Chore: Handle Octokit type changes and removal of oauthAuthorizations Close webhintio#4653
Add some mimetypes for images/audio/video.
…to feat/moar-longcache-mimes
JPEG-XL is currently available in Firefox, Chromium, and derivatives (e.g. Edge) behind a pref; it will be landing soon. It should be cached no differently from other image formats.
Add some mimetypes for images/audio/video.
Pull request checklist
Make sure you:
Short description of the change(s)
Add some mimetypes for long-lived resources to the
http-cache
hint.