@jsenv/core 29.1.13 → 29.1.14

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/dist/main.js CHANGED
@@ -25759,7 +25759,12 @@ const createFileService = ({
25759
25759
  response = {
25760
25760
  url: reference.url,
25761
25761
  status: 200,
25762
- headers: { ...(urlInfo.headers["cache-control"] === "no-store" ? {} : {
25762
+ headers: { // when we send eTag to the client the next request to the server
25763
+ // will send etag in request headers.
25764
+ // If they match jsenv bypass cooking and returns 304
25765
+ // This must not happen when a plugin uses "no-store" or "no-cache" as it means
25766
+ // plugin logic wants to happens for every request to this url
25767
+ ...(urlInfo.headers["cache-control"] === "no-store" || urlInfo.headers["cache-control"] === "no-cache" ? {} : {
25763
25768
  "cache-control": `private,max-age=0,must-revalidate`,
25764
25769
  // it's safe to use "_" separator because etag is encoded with base64 (see https://stackoverflow.com/a/13195197)
25765
25770
  "eTag": `${urlInfoTargetedByCache.originalContentEtag}_${urlInfoTargetedByCache.contentEtag}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "29.1.13",
3
+ "version": "29.1.14",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -334,7 +334,13 @@ export const createFileService = ({
334
334
  url: reference.url,
335
335
  status: 200,
336
336
  headers: {
337
- ...(urlInfo.headers["cache-control"] === "no-store"
337
+ // when we send eTag to the client the next request to the server
338
+ // will send etag in request headers.
339
+ // If they match jsenv bypass cooking and returns 304
340
+ // This must not happen when a plugin uses "no-store" or "no-cache" as it means
341
+ // plugin logic wants to happens for every request to this url
342
+ ...(urlInfo.headers["cache-control"] === "no-store" ||
343
+ urlInfo.headers["cache-control"] === "no-cache"
338
344
  ? {}
339
345
  : {
340
346
  "cache-control": `private,max-age=0,must-revalidate`,