forked from openapiv1/atlas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmiddleware.ts
More file actions
25 lines (21 loc) · 1005 Bytes
/
middleware.ts
File metadata and controls
25 lines (21 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
export function middleware(request: NextRequest) {
const response = NextResponse.next()
// ULTRA AGGRESSIVE CACHE BLOCKING - PERMANENT AND COMPLETE
response.headers.set('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0, s-maxage=0, no-transform, private')
response.headers.set('Pragma', 'no-cache')
response.headers.set('Expires', '-1')
response.headers.set('Surrogate-Control', 'no-store')
response.headers.set('CDN-Cache-Control', 'no-store')
response.headers.set('Cloudflare-CDN-Cache-Control', 'no-store')
response.headers.set('Vercel-CDN-Cache-Control', 'no-store')
response.headers.set('Edge-Cache-Control', 'no-store')
response.headers.set('Clear-Site-Data', '"cache", "cookies", "storage"')
return response
}
export const config = {
matcher: [
'/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)',
],
}