You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2023/04/19 02:39:53 UTC

[GitHub] [incubator-kvrocks-website] tisonkun commented on a diff in pull request #92: refactor: improve static assets url in dev env

tisonkun commented on code in PR #92:
URL: https://github.com/apache/incubator-kvrocks-website/pull/92#discussion_r1170749761


##########
src/cdn.ts:
##########
@@ -0,0 +1,13 @@
+export function resolveStaticAssetsURL(path: string) {
+    if (!path.startsWith('/')) {
+        path = '/' + path;
+    }
+
+    if (process.env.NODE_ENV === 'development') {
+        return path;
+    }
+
+    // The DNS for cdn.jsdelivr.net and fastly.jsdelivr.net cannot be accessed from some regions.
+    // For now, gcore.jsdelivr.net is still accessible, but its future availability is uncertain.
+    return 'https://gcore.jsdelivr.net/gh/apache/incubator-kvrocks-website@main/static' + path;

Review Comment:
   This can be a follow-up to introduce some fallback logics if the CDN is unavailable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org