diff --git a/src/storage/get-id-from-url.js b/src/storage/get-id-from-url.js
index <HASH>..<HASH> 100644
--- a/src/storage/get-id-from-url.js
+++ b/src/storage/get-id-from-url.js
@@ -2,22 +2,23 @@ import configs from '../core/configs.js'
 
 // constants
 var URL_TO_ID_CACHE = {}
-var IS_URL = new RegExp(
-  '^(http(s?))\\:\\/\\/(' +
-    configs.storageDomain +
-    '|' +
-    configs.storageDomainNoCdn +
-    ')'
-)
 
 // main
 export default function getStorageIdFromUrl(url) {
   // check cache
   if (URL_TO_ID_CACHE[url]) return URL_TO_ID_CACHE[url]
 
+  var isStorageRegexp = new RegExp(
+    '^(http(s?))\\:\\/\\/(' +
+    configs.storageDomain +
+    '|' +
+    configs.storageDomainNoCdn +
+    ')'
+  )
+
   // check if url is valid url
-  if (IS_URL.test(url)) {
-    var storageId = url.replace(IS_URL, '')
+  if (isStorageRegexp.test(url)) {
+    var storageId = url.replace(isStorageRegexp, '')
     // add to cache
     URL_TO_ID_CACHE[url] = storageId
     return storageId
create regexp on runtine (as config might change on runtime)