Part of the alepha package. Import from alepha/server/cache.
npm install alepha
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.
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);