GitHub

RDK

Caching

You can invalidate your cached responses via RDK.

  • You cannot invalidate more than 5 cached responses in parralel
interface InvalidateCache {
    classId?: string
    methodName?: string
    instanceId?: string
}


interface InvalidateCacheResponse {
    success: boolean
    data?: {
        id: string
    }
    error?: string
}


async function invalidateCache(input: InvalidateCache): Promise<InvalidateCacheResponse | undefined> {
    // ...
}

Usage

import RDK from '@retter/rdk'


const rdk = new RDK()


await rdk.invalidateCache({ classId: 'User', instanceId: 'user001', methodName: 'getProfile' })


await rdk.pipeline()
    .invalidateCache({ classId: 'User', instanceId: 'user000', methodName: 'getProfile' })
    .invalidateCache({ classId: 'User', instanceId: 'user001', methodName: 'getProfile' })
    .send()

API Reference

Invalidate Cache Input

ParameterTypeRequiredDescription
classIdstringfalseClass ID of cached response
methodNamestringfalseMethod name of cached response
instanceIdstringfalseInstance ID of cached response

Invalidate Cache Output

ParameterTypeRequiredDescription
successbooleantrueReturns true if operation is successful
data{ id: string }falseSuccessful response
errorstringfalseReason of failure
Previous
Deployment