mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-25 17:08:35 +03:00
Add client-side caching
This commit is contained in:
@@ -3,6 +3,7 @@ import { Feature, HashedUserID, UserID } from "../types/user.model";
|
||||
import { HashedValue } from "../types/hash.model";
|
||||
import { Logger } from "./logger";
|
||||
import { BrandingUUID } from "../types/branding.model";
|
||||
import { RedisCommandArgument } from "@redis/client/dist/lib/commands";
|
||||
|
||||
export const skipSegmentsKey = (videoID: VideoID, service: Service): string =>
|
||||
`segments.v6.${service}.videoID.${videoID}`;
|
||||
@@ -65,4 +66,8 @@ export function videoLabelsHashKey(hashedVideoIDPrefix: VideoIDHash, service: Se
|
||||
|
||||
export function userFeatureKey (userID: HashedUserID, feature: Feature): string {
|
||||
return `user.v2.${userID}.feature.${feature}`;
|
||||
}
|
||||
|
||||
export function shouldClientCacheKey(key: RedisCommandArgument): boolean {
|
||||
return (key as string).startsWith("segments.");
|
||||
}
|
||||
Reference in New Issue
Block a user