@ui5/server 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/lib/middleware/serveResources.js +11 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
-
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-server/compare/v4.0.
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-server/compare/v4.0.1...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v4.0.1"></a>
|
|
8
|
+
## [v4.0.1] - 2024-07-31
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
- **serveResources:** Improve cache invalidation ([#688](https://github.com/SAP/ui5-server/issues/688)) [`777afa5`](https://github.com/SAP/ui5-server/commit/777afa52e459f988e0799ae63b8a9b024db0c398)
|
|
11
|
+
|
|
6
12
|
|
|
7
13
|
<a name="v4.0.0"></a>
|
|
8
14
|
## [v4.0.0] - 2024-07-23
|
|
@@ -363,6 +369,7 @@ Only Node.js v10 or higher is supported.
|
|
|
363
369
|
|
|
364
370
|
<a name="v0.0.1"></a>
|
|
365
371
|
## v0.0.1 - 2018-06-06
|
|
372
|
+
[v4.0.1]: https://github.com/SAP/ui5-server/compare/v4.0.0...v4.0.1
|
|
366
373
|
[v4.0.0]: https://github.com/SAP/ui5-server/compare/v3.1.5...v4.0.0
|
|
367
374
|
[v3.2.1]: https://github.com/SAP/ui5-server/compare/v3.2.0...v3.2.1
|
|
368
375
|
[v3.2.0]: https://github.com/SAP/ui5-server/compare/v3.1.5...v3.2.0
|
|
@@ -95,10 +95,18 @@ function createMiddleware({resources, middlewareUtil}) {
|
|
|
95
95
|
|
|
96
96
|
// Enable ETag caching
|
|
97
97
|
const statInfo = resource.getStatInfo();
|
|
98
|
-
if (statInfo?.size !== undefined) {
|
|
99
|
-
|
|
98
|
+
if (statInfo?.size !== undefined && !resource.isModified()) {
|
|
99
|
+
let etagHeader = etag(statInfo);
|
|
100
|
+
if (resource.getProject()) {
|
|
101
|
+
// Add project version to ETag to invalidate cache when project version changes.
|
|
102
|
+
// This is necessary to invalidate files with ${version} placeholders.
|
|
103
|
+
etagHeader = etagHeader.slice(0, -1) + `-${resource.getProject().getVersion()}"`;
|
|
104
|
+
}
|
|
105
|
+
res.setHeader("ETag", etagHeader);
|
|
100
106
|
} else {
|
|
101
|
-
// Fallback to buffer if stats are not available or insufficient
|
|
107
|
+
// Fallback to buffer if stats are not available or insufficient or resource is modified.
|
|
108
|
+
// Modified resources must use the buffer for cache invalidation so that UI5 Tooling changes
|
|
109
|
+
// invalidate the cache even when the original resource is not modified.
|
|
102
110
|
res.setHeader("ETag", etag(await resource.getBuffer()));
|
|
103
111
|
}
|
|
104
112
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/server",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "UI5 Tooling - Server",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SAP SE",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"url": "git@github.com:SAP/ui5-server.git"
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
|
-
"@ui5/builder": "^4.0.
|
|
120
|
+
"@ui5/builder": "^4.0.1",
|
|
121
121
|
"@ui5/fs": "^4.0.0",
|
|
122
122
|
"@ui5/logger": "^4.0.1",
|
|
123
123
|
"body-parser": "^1.20.2",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
141
|
"@istanbuljs/esm-loader-hook": "^0.2.0",
|
|
142
|
-
"@ui5/project": "^4.0.
|
|
142
|
+
"@ui5/project": "^4.0.1",
|
|
143
143
|
"ava": "^6.1.3",
|
|
144
144
|
"chokidar-cli": "^3.0.0",
|
|
145
145
|
"cross-env": "^7.0.3",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"eslint": "^8.57.0",
|
|
149
149
|
"eslint-config-google": "^0.14.0",
|
|
150
150
|
"eslint-plugin-ava": "^14.0.0",
|
|
151
|
-
"eslint-plugin-jsdoc": "^48.
|
|
151
|
+
"eslint-plugin-jsdoc": "^48.10.2",
|
|
152
152
|
"esmock": "^2.6.7",
|
|
153
153
|
"jsdoc": "^4.0.3",
|
|
154
154
|
"nyc": "^17.0.0",
|