Skip to main content

Add and retrieve a file with Momento Cache

An item in Momento Cache is a byte array, so a cache can easily store most any file you want to create, as long as it is under the per item limit of 1MB.

Here is an example of reading a file from the filesystem, saving the file to an item in a cache, reading it from the cache, and then writing it to the filesystem.

<SdkExampleCodeBlock language={'javascript'} file={'examples/nodejs/cache/doc-example-files/working-with-files.ts'} />