video-redis-key-inventory.md 2.4 KB

Video Redis Key Inventory

Key pattern Writer(s) Reader(s) Value type TTL Notes
box:app:video:category:list:{categoryId} VideoCategoryCacheBuilder.buildCategoryVideoListForCategory VideoService.getLatestVideosByCategory, VideoService.getVideosByCategoryListFallback, VideoService.getVideoList (category-only flow), searchVideosByTagName fallback when tag list missing LIST (video IDs) none Canonical list that stores only IDs. VideoCacheHelper ensures legacy box:box:... keys are handled.
box:app:video:tag:list:{categoryId}:{tagId} VideoCategoryCacheBuilder.buildTagFilteredVideoListForTag VideoService.getVideoList (tag filter), VideoService.getVideosByTagListFallback, searchVideosByTagName LIST (video IDs) none Readers rely on the list ordering preserved by the builder.
box:app:tag:list:{categoryId} VideoCategoryCacheBuilder.buildTagMetadataListForCategory VideoService.getTagListForCategory, VideoService.getCategoriesWithTags, VideoService.getVideoList (tag lookup), searchVideosByTagName, admin diagnostics LIST (Tag JSON strings) none Helper parses JSON into TagMetadata. Legacy double-prefixed keys are touched by VideoCacheHelper fallback and admin cleanup.
box:app:video:recommended RecommendedVideosCacheBuilder.buildAll VideoService.getRecommendedVideos JSON array (RecommendedVideoItem[]) 3600s TTL enforced by builder; refreshed via cache sync.
box:app:video:detail:{videoId} None (ghost key) VideoService.getVideoDetail JSON object (full VideoDetailDto) unspecified Readers still reference this key even though no builders populate it; treat as a legacy/ghost key and consider migrating to the payload cache spec.
box:app:video:payload:{videoId} (planned, follows spec) (future readers) JSON object with only {id,title,coverImg,coverImgNew,videoTime,country,firstTag,secondTags,preFileName,desc,size,updatedAt,filename,fieldNameFs,ext} TBD (align with writer) New minimal payload key described in docs/video-redis-key-spec.md. Use CacheKeys.appVideoPayloadKey / tsCacheKeys.video.payload for generation.

The inventory above complements the VideoCacheHelper fallback logic: all LIST readers now go through helpers that try the correct app: key first and rewrite any legacy box:box: entries encountered.