diff --git a/server/package-lock.json b/server/package-lock.json index 0d11f4b..42bcb29 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -10,6 +10,7 @@ "license": "AGPL-3.0-or-later", "dependencies": { "@expo/spawn-async": "^1.7.2", + "@fastify/send": "^3.1.1", "@fastify/static": "^8.0.2", "@wordpress/escape-html": "^3.11.0", "axios": "^1.7.7", @@ -2922,6 +2923,30 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "send": { + "name": "@fastify/send", + "version": "3.1.1", + "extraneous": true, + "license": "MIT", + "dependencies": { + "@lukeed/ms": "^2.0.2", + "escape-html": "~1.0.3", + "fast-decode-uri-component": "^1.0.1", + "http-errors": "^2.0.0", + "mime": "^3" + }, + "devDependencies": { + "@fastify/pre-commit": "^2.1.0", + "@types/node": "^22.0.0", + "after": "0.8.2", + "benchmark": "^2.1.4", + "snazzy": "^9.0.0", + "standard": "^17.1.0", + "supertest": "6.3.4", + "tap": "^21.0.0", + "tsd": "^0.31.0" + } } } } diff --git a/server/package.json b/server/package.json index 197e047..e625722 100644 --- a/server/package.json +++ b/server/package.json @@ -36,6 +36,7 @@ }, "dependencies": { "@expo/spawn-async": "^1.7.2", + "@fastify/send": "^3.1.1", "@fastify/static": "^8.0.2", "@wordpress/escape-html": "^3.11.0", "axios": "^1.7.7", diff --git a/server/src/controller/both/EntityController.ts b/server/src/controller/both/EntityController.ts index 5287c47..7d8a034 100644 --- a/server/src/controller/both/EntityController.ts +++ b/server/src/controller/both/EntityController.ts @@ -64,10 +64,11 @@ export default class EntityController { // Make a file stream const sendOption: SendOptions = { 'acceptRanges': true, - 'cacheControl': true, + // 'maxChunkSize': 1024 * 1024 * 8, + // 'cacheControl': true, 'root': rootPath, - 'immutable': true, - 'maxAge': 24 * 3600 * 7, + // 'immutable': true, + // 'maxAge': 24 * 3600 * 7 * 1000, }; const sendResult = await send(req.raw, encodeURI(entityPath), sendOption); if (sendResult.type !== 'file') {