code-workshop-kit
Version:
The future of remote code workshops & training
13 lines (9 loc) • 348 B
text/typescript
import { Context, Next } from 'koa';
import { cwkState } from '../utils/CwkStateSingleton';
export const noCacheMiddleware = async (ctx: Context, next: Next): Promise<void> => {
await next();
const { adminConfig } = cwkState.state;
if (adminConfig && !adminConfig.enableCaching) {
ctx.response.set('cache-control', 'no-store');
}
};