1import { createApp, autoCacheMiddleware } from "canxjs";
2
3const app = createApp();
4
5// Enable AutoCache
6// It automatically detects frequent, slow GET requests and caches them.
7app.use(autoCacheMiddleware({
8 enabled: true,
9 defaultTtl: 300, // 5 minutes
10 exclude: ['/api/auth/*', '/api/admin/*']
11}));