alepha@docs:~/docs/packages/alepha/server$
cat cache.md
1 min read
Last commit:

#Alepha - Server Cache

#Installation

Part of the alepha package. Import from alepha/server/cache.

npm install alepha

#Overview

Plugin for Alepha Server that provides server-side caching capabilities. It uses the Alepha Cache module to cache responses from server actions ($action). It also provides a ETag-based cache invalidation mechanism.

ts
 1import { Alepha } from "alepha"; 2import { $action } from "alepha/server"; 3import { AlephaServerCache } from "alepha/server/cache"; 4  5class ApiServer { 6  hello = $action({ 7    cache: true, 8    handler: () => "Hello, World!", 9  });10}11 12const alepha = Alepha.create()13  .with(AlephaServerCache)14  .with(ApiServer);15 16run(alepha);
On This Page
No headings found...
ready
mainTypeScript
UTF-8packages_alepha_server_cache.md