From 6f12fd22b9ea6ae50a627f67c446f3a418baf57c Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 2 Jul 2025 01:49:00 +0000 Subject: [PATCH] Optimize image API invalidation tags and simplify cache invalidation logic Co-authored-by: kent --- .../web/src/services/api/endpoints/images.ts | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/invokeai/frontend/web/src/services/api/endpoints/images.ts b/invokeai/frontend/web/src/services/api/endpoints/images.ts index 0da70b0c5a..bd469d3c71 100644 --- a/invokeai/frontend/web/src/services/api/endpoints/images.ts +++ b/invokeai/frontend/web/src/services/api/endpoints/images.ts @@ -270,25 +270,13 @@ export const imagesApi = api.injectEndpoints({ // Don't add it to anything return []; } - const categories = getCategories(result); const boardId = result.board_id ?? 'none'; return [ - { - type: 'ImageList', - id: getListImagesUrl({ - board_id: boardId, - categories, - }), - }, - { - type: 'Board', - id: boardId, - }, - { - type: 'BoardImagesTotal', - id: boardId, - }, + ...getTagsToInvalidateForImageMutation([result.image_name]), + ...getTagsToInvalidateForBoardAffectingMutation([boardId]), + 'ImageCollectionCounts', + { type: 'ImageCollection', id: LIST_TAG }, ]; }, }),