From 1dc2c736d30715eac1eaf046db9be4161f957bcc Mon Sep 17 00:00:00 2001 From: Artur Chrusciel Date: Tue, 24 Oct 2017 08:59:26 +0200 Subject: [PATCH] URL cache host part hash --- utils/pathUtils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/pathUtils.js b/utils/pathUtils.js index e8cd172..372c321 100644 --- a/utils/pathUtils.js +++ b/utils/pathUtils.js @@ -45,7 +45,9 @@ function getHostCachePathComponent(url) { const { host } = new URL(url); - return host.replace(/[^a-z0-9]/gi, '').toLowerCase(); + + return host.replace(/\.:/gi, '_').replace(/[^a-z0-9_]/gi, '_').toLowerCase() + + '_' + SHA1(host); } /**