Skip to main content

Interface: CacheInvalidatedEventData

Defined in: shared/types/events.ts:50

Payload for cache invalidation events.

Remarksโ€‹

Used to notify listeners that a cache entry or the entire cache has been invalidated for a specific reason. - identifier: The specific identifier affected (optional for global invalidation). - reason: The reason for invalidation.

  • timestamp: The time (in ms since epoch) when invalidation occurred.
  • type: The type of cache invalidation.

Exampleโ€‹

const event: CacheInvalidatedEventData = {
type: "all",
reason: "manual",
timestamp: Date.now(),
};

Extendsโ€‹

Propertiesโ€‹

timestampโ€‹

timestamp: number

Defined in: shared/types/events.ts:25

The time (in ms since epoch) when the event occurred.

Inherited fromโ€‹

BaseEventData.timestamp


identifier?โ€‹

readonly optional identifier: string

Defined in: shared/types/events.ts:57

The specific identifier affected (optional for global invalidation).

Remarksโ€‹

If omitted, the invalidation is considered global.


reasonโ€‹

readonly reason: "delete" | "expiry" | "manual" | "update"

Defined in: shared/types/events.ts:64

The reason for invalidation.

Remarksโ€‹

Can be 'delete', 'expiry', 'manual', or 'update'.


typeโ€‹

readonly type: "all" | "monitor" | "site"

Defined in: shared/types/events.ts:72

The type of cache invalidation.

Remarksโ€‹

'all' for global, 'monitor' for a specific monitor, 'site' for a specific site.