description |
---|
One of the two hardest problems in computer science |
The Cache Control Plane is responsible for speeding up and making a LearnCard more efficient through the use of Caching.
To better encourage and allow separation of the caching between different planes, Cache plugins are required to implement separate caching methods for each plane. In general, when consuming a LearnCard object, you should rarely, if ever, need to interact with the cache directly—it should just work underneath each of the other Planes 🚀!
The Cache Plane implements ten methods: getIndex
, setIndex
, getIndexPage
, setIndexPage
, (optionally) getIndexCount
, (optionally) setIndexCount
, flushIndex
, getVc
, setVc
, and flushVc
The getIndex
method takes in a query returns a list of CredentialRecords
, similar to the Index Plane's get
method.
The setIndex
method takes in a query and a list of CredentialRecords
and caches the records against the query, returning true
if successful and false
if not.
The getIndexPage
method takes in a query with pagination options and returns a paginated result of CredentialRecord
s, similar to the Index Plane's getPage
method.
The setIndexPage
method takes in a query with pagination options and a paginated result of CredentialRecord
s and caches the result against the query/options, returning true
if successful and false
if not.
The getIndexCount
method takes in a query and returns a number, intending to cache the Index Plane's getCount
method.
The setIndexCount
method takes in a query and number and caches the number against the query, returning true
if successful and false
if not.
The flushIndex
method empties out everything in the cache that can be returned by getIndex
, getIndexPage
, or getIndexCount
The getVc
method takes in a URI and returns a Verifiable Credential, similar to the Read Plane's get
method.
The setVc
method takes in a URI and a Verifiable Credential and caches the Verifiable Credential against the URI, returning true
if successful and false
if not.
The flushVc
method empties out everything in the cache that can be returned by getVc.
{% hint style="warning" %} 🚧 This section is under construction. Thank you for being patient while our community gets another cup of coffee to finish these docs! ☕️I {% endhint %}