@react-router/serve 0.0.0-experimental-4ed3f5da9 → 0.0.0-experimental-cb25a21e1

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.
Files changed (2) hide show
  1. package/dist/cli.js +7 -3
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @react-router/serve v0.0.0-experimental-4ed3f5da9
3
+ * @react-router/serve v0.0.0-experimental-cb25a21e1
4
4
  *
5
5
  * Copyright (c) Remix Software Inc.
6
6
  *
@@ -86,11 +86,15 @@ async function run() {
86
86
  app.disable("x-powered-by");
87
87
  app.use(compression__default["default"]());
88
88
  app.use(build.publicPath, express__default["default"].static(build.assetsBuildDirectory, {
89
- immutable: true,
90
- maxAge: "1y",
91
89
  setHeaders: function (res, path, stat) {
92
90
  if (path.endsWith(".data")) {
93
91
  res.set("Content-Type", "text/x-turbo");
92
+ } else {
93
+ // Cache as an immutable asset for 1 year
94
+ // Do this here instead of via the immutable/maxAge headers so we can
95
+ // conditionally apply it to assets (which are hashed), and not
96
+ // pre-rendered .data files (not hashed)
97
+ res.set("Cache-Control", "public, max-age=31536000, immutable");
94
98
  }
95
99
  }
96
100
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-router/serve",
3
- "version": "0.0.0-experimental-4ed3f5da9",
3
+ "version": "0.0.0-experimental-cb25a21e1",
4
4
  "description": "Production application server for React Router",
5
5
  "bugs": {
6
6
  "url": "https://github.com/remix-run/react-router/issues"
@@ -20,8 +20,8 @@
20
20
  "get-port": "5.1.1",
21
21
  "morgan": "^1.10.0",
22
22
  "source-map-support": "^0.5.21",
23
- "@react-router/express": "0.0.0-experimental-4ed3f5da9",
24
- "@react-router/node": "0.0.0-experimental-4ed3f5da9"
23
+ "@react-router/express": "0.0.0-experimental-cb25a21e1",
24
+ "@react-router/node": "0.0.0-experimental-cb25a21e1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/compression": "^1.7.0",