-
Notifications
You must be signed in to change notification settings - Fork 26.2k
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
Add minimumCacheTTL
config for Image Optimization
#27200
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6 tasks
This comment has been minimized.
This comment has been minimized.
ijjk
previously approved these changes
Jul 15, 2021
This comment has been minimized.
This comment has been minimized.
minimumCacheTtl
config for Image OptimizationminimumCacheTTL
config for Image Optimization
ijjk
approved these changes
Jul 15, 2021
Stats from current PRDefault Build (Increase detected
|
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
buildDuration | 15.7s | 15.7s | |
buildDurationCached | 3.7s | 3.6s | -119ms |
nodeModulesSize | 49.4 MB | 49.4 MB |
Page Load Tests Overall decrease ⚠️
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.682 | 2.684 | 0 |
/ avg req/sec | 931.99 | 931.61 | |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.638 | 1.69 | |
/error-in-render avg req/sec | 1526.15 | 1479.66 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
359.HASH.js gzip | 2.96 kB | 2.96 kB | ✓ |
framework-HASH.js gzip | 42 kB | 42 kB | ✓ |
main-HASH.js gzip | 20.9 kB | 20.9 kB | ✓ |
webpack-HASH.js gzip | 1.49 kB | 1.49 kB | ✓ |
Overall change | 67.4 kB | 67.4 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.1 kB | 31.1 kB | ✓ |
Overall change | 31.1 kB | 31.1 kB | ✓ |
Client Pages Overall increase ⚠️
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
_app-HASH.js gzip | 803 B | 803 B | ✓ |
_error-HASH.js gzip | 3.06 kB | 3.06 kB | ✓ |
amp-HASH.js gzip | 554 B | 554 B | ✓ |
css-HASH.js gzip | 329 B | 329 B | ✓ |
hooks-HASH.js gzip | 903 B | 903 B | ✓ |
image-HASH.js gzip | 5.58 kB | 5.6 kB | |
index-HASH.js gzip | 261 B | 261 B | ✓ |
link-HASH.js gzip | 1.66 kB | 1.66 kB | ✓ |
routerDirect..HASH.js gzip | 319 B | 319 B | ✓ |
withRouter-HASH.js gzip | 320 B | 320 B | ✓ |
bb14e60e810b..30f.css gzip | 125 B | 125 B | ✓ |
Overall change | 13.9 kB | 13.9 kB |
Client Build Manifests Overall decrease ✓
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
_buildManifest.js gzip | 418 B | 417 B | -1 B |
Overall change | 418 B | 417 B | -1 B |
Rendered Page Sizes
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
index.html gzip | 531 B | 531 B | ✓ |
link.html gzip | 545 B | 545 B | ✓ |
withRouter.html gzip | 526 B | 526 B | ✓ |
Overall change | 1.6 kB | 1.6 kB | ✓ |
Diffs
Diff for _buildManifest.js
@@ -13,7 +13,7 @@ self.__BUILD_MANIFEST = {
"static\u002Fchunks\u002Fpages\u002Fhooks-4e38b05900fed34fcf34.js"
],
"/image": [
- "static\u002Fchunks\u002Fpages\u002Fimage-011996dbc6095969738b.js"
+ "static\u002Fchunks\u002Fpages\u002Fimage-84f762b2104d16092912.js"
],
"/link": ["static\u002Fchunks\u002Fpages\u002Flink-36845453cb7a35e1a731.js"],
"/routerDirect": [
Diff for image-HASH.js
@@ -1551,7 +1551,8 @@
path: "/_next/image",
loader: "default",
domains: [],
- disableStaticImages: false
+ disableStaticImages: false,
+ minimumCacheTTL: 60
};
exports.imageConfigDefault = imageConfigDefault;
Webpack 4 Mode (Increase detected ⚠️ )
General Overall increase ⚠️
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
buildDuration | 12.7s | 12.9s | |
buildDurationCached | 5s | 5s | -8ms |
nodeModulesSize | 49.4 MB | 49.4 MB |
Page Load Tests Overall increase ✓
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
/ failed reqs | 0 | 0 | ✓ |
/ total time (seconds) | 2.814 | 2.787 | -0.03 |
/ avg req/sec | 888.44 | 897.14 | +8.7 |
/error-in-render failed reqs | 0 | 0 | ✓ |
/error-in-render total time (seconds) | 1.638 | 1.64 | 0 |
/error-in-render avg req/sec | 1526.39 | 1524.66 |
Client Bundles (main, webpack, commons)
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
14.HASH.js gzip | 2.98 kB | 2.98 kB | ✓ |
677f882d2ed8..HASH.js gzip | 13.7 kB | 13.7 kB | ✓ |
framework.HASH.js gzip | 41.8 kB | 41.8 kB | ✓ |
main-HASH.js gzip | 8.39 kB | 8.39 kB | ✓ |
webpack-HASH.js gzip | 1.19 kB | 1.19 kB | ✓ |
Overall change | 68 kB | 68 kB | ✓ |
Legacy Client Bundles (polyfills)
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
polyfills-HASH.js gzip | 31.3 kB | 31.3 kB | ✓ |
Overall change | 31.3 kB | 31.3 kB | ✓ |
Client Pages
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
_app-HASH.js gzip | 791 B | 791 B | ✓ |
_error-HASH.js gzip | 3.76 kB | 3.76 kB | ✓ |
amp-HASH.js gzip | 552 B | 552 B | ✓ |
css-HASH.js gzip | 333 B | 333 B | ✓ |
hooks-HASH.js gzip | 910 B | 910 B | ✓ |
index-HASH.js gzip | 230 B | 230 B | ✓ |
link-HASH.js gzip | 1.64 kB | 1.64 kB | ✓ |
routerDirect..HASH.js gzip | 297 B | 297 B | ✓ |
withRouter-HASH.js gzip | 293 B | 293 B | ✓ |
e025d2764813..52f.css gzip | 125 B | 125 B | ✓ |
Overall change | 8.93 kB | 8.93 kB | ✓ |
Client Build Manifests
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
_buildManifest.js gzip | 420 B | 420 B | ✓ |
Overall change | 420 B | 420 B | ✓ |
Rendered Page Sizes
vercel/next.js canary | vercel/next.js add-image-max-age-config | Change | |
---|---|---|---|
index.html gzip | 574 B | 574 B | ✓ |
link.html gzip | 588 B | 588 B | ✓ |
withRouter.html gzip | 568 B | 568 B | ✓ |
Overall change | 1.73 kB | 1.73 kB | ✓ |
kodiakhq bot
pushed a commit
that referenced
this pull request
Jul 19, 2021
In a previous PR (#27200), we added `minimumCacheTTL` to configure the time-to-live for the cached image. However, this was setting the `max-age` header. This PR ensures that `minimumCacheTTL` doesn't affect browser caching, only the upstream header can affect browser caching. This is a bit safer in case the developer accidentally caches something that shouldn't be and the cache needs to be invalidated. Simply delete the `.next/cache/images` directory. - Related to #19914 - Related to #22319
flybayer
pushed a commit
to blitz-js/next.js
that referenced
this pull request
Aug 19, 2021
- Closes vercel#23328 - Related to vercel#19914 - Related to vercel#22319 ## Feature - [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [x] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [x] Errors have helpful link attached, see `contributing.md`
flybayer
pushed a commit
to blitz-js/next.js
that referenced
this pull request
Aug 19, 2021
) In a previous PR (vercel#27200), we added `minimumCacheTTL` to configure the time-to-live for the cached image. However, this was setting the `max-age` header. This PR ensures that `minimumCacheTTL` doesn't affect browser caching, only the upstream header can affect browser caching. This is a bit safer in case the developer accidentally caches something that shouldn't be and the cache needs to be invalidated. Simply delete the `.next/cache/images` directory. - Related to vercel#19914 - Related to vercel#22319
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
/_next/image
#19914Feature
fixes #number
contributing.md