mirror of
https://github.com/directus/directus.git
synced 2026-02-01 09:05:01 -05:00
11 lines
274 B
TypeScript
11 lines
274 B
TypeScript
import { Request } from 'express';
|
|
import url from 'url';
|
|
|
|
export function getCacheKey(req: Request) {
|
|
const path = url.parse(req.originalUrl).pathname;
|
|
const key = `${req.accountability?.user || 'null'}-${path}-${JSON.stringify(
|
|
req.sanitizedQuery
|
|
)}`;
|
|
return key;
|
|
}
|