diff --git a/packages/strapi-plugin-rest-cache/server/utils/keys/generateCacheKey.js b/packages/strapi-plugin-rest-cache/server/utils/keys/generateCacheKey.js index dc26cf8df..02e0ffff5 100644 --- a/packages/strapi-plugin-rest-cache/server/utils/keys/generateCacheKey.js +++ b/packages/strapi-plugin-rest-cache/server/utils/keys/generateCacheKey.js @@ -23,7 +23,10 @@ function generateCacheKey( headersSuffix = generateHeadersKey(ctx, keys.useHeaders); } - const requestPath = toLower(ctx.request.path); + const requestPath = toLower(path.posix.normalize(ctx.request.path)).replace( + /\/$/, + '' + ); return `${requestPath}?${querySuffix}&${headersSuffix}`; }