diff --git a/package-lock.json b/package-lock.json index ea33a63..740aa60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7792,7 +7792,8 @@ "@well-known-components/logger": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@well-known-components/logger/-/logger-3.1.3.tgz", - "integrity": "sha512-tTjD27CdfU4SVe+kPfjRbPSqdrw0Crg+M31RNejinCuMEBtEGbhYLtB1M4gn+PSTy2Oi3cI3iOdeQ1xVhMSerQ==" + "integrity": "sha512-tTjD27CdfU4SVe+kPfjRbPSqdrw0Crg+M31RNejinCuMEBtEGbhYLtB1M4gn+PSTy2Oi3cI3iOdeQ1xVhMSerQ==", + "requires": {} }, "@well-known-components/metrics": { "version": "2.0.1", @@ -7887,7 +7888,8 @@ "ajv-errors": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", - "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==" + "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", + "requires": {} }, "ajv-keywords": { "version": "5.1.0", @@ -9400,7 +9402,8 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", - "dev": true + "dev": true, + "requires": {} }, "jest-regex-util": { "version": "29.2.0", @@ -10810,7 +10813,8 @@ "ws": { "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==" + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "requires": {} }, "y18n": { "version": "5.0.8", diff --git a/src/logic/last-modified-middleware.ts b/src/logic/last-modified-middleware.ts index 628eada..51a4cb7 100644 --- a/src/logic/last-modified-middleware.ts +++ b/src/logic/last-modified-middleware.ts @@ -14,24 +14,24 @@ export function lastModifiedMiddleware( const cacheControlHeader = `max-age=${options.maxAge}, stale-while-revalidate=${options.staleWhileRevalidate}, public` return async (context, next): Promise => { - const lastModifiedTime = getLastModifiedTime() - const ifModifiedSinceHeader = - context.request.headers.get('If-Modified-Since') + // const lastModifiedTime = getLastModifiedTime() + // const ifModifiedSinceHeader = + // context.request.headers.get('If-Modified-Since') - if (ifModifiedSinceHeader) { - const ifModifiedSinceTime = Date.parse(ifModifiedSinceHeader) - if ( - !isNaN(ifModifiedSinceTime) && - lastModifiedTime <= ifModifiedSinceTime - ) { - return { - status: 304, - headers: { - 'Cache-Control': cacheControlHeader, - }, - } - } - } + // if (ifModifiedSinceHeader) { + // const ifModifiedSinceTime = Date.parse(ifModifiedSinceHeader) + // if ( + // !isNaN(ifModifiedSinceTime) && + // lastModifiedTime <= ifModifiedSinceTime + // ) { + // return { + // status: 304, + // headers: { + // 'Cache-Control': cacheControlHeader, + // }, + // } + // } + // } const response = await next() response.headers = {