From b3a82b1b20fcbc3aff8815f95d4f37fc6624dded Mon Sep 17 00:00:00 2001 From: Alex Tran Date: Wed, 26 Oct 2022 23:55:38 -0500 Subject: [PATCH] Update cache for thumbnail --- server/apps/immich/src/api-v1/asset/asset.controller.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/apps/immich/src/api-v1/asset/asset.controller.ts b/server/apps/immich/src/api-v1/asset/asset.controller.ts index 88479cbf7e..8f8c16a4ff 100644 --- a/server/apps/immich/src/api-v1/asset/asset.controller.ts +++ b/server/apps/immich/src/api-v1/asset/asset.controller.ts @@ -15,6 +15,7 @@ import { HttpCode, BadRequestException, UploadedFile, + Header, } from '@nestjs/common'; import { JwtAuthGuard } from '../../modules/immich-jwt/guards/jwt-auth.guard'; import { AssetService } from './asset.service'; @@ -143,6 +144,7 @@ export class AssetController { } @Get('/thumbnail/:assetId') + @Header('Cache-Control', 'max-age=300') async getAssetThumbnail( @Response({ passthrough: true }) res: Res, @Param('assetId') assetId: string, @@ -260,7 +262,7 @@ export class AssetController { } /** - * Checks if multiple assets exist on the server and returns all existing - used by background backup + * Checks if multiple assets exist on the server and returns all existing - used by background backup */ @Post('/exist') @HttpCode(200)