[server] Leverage a CDN

pi0
39
pi0
commented 2 years ago

What problem does this feature solve?

Currently, different subdomains share exactly same resources with different URLs:

A CDN can easily serve _nuxt directory under cdn.cmty.io so users have faster page loads when working with different cmty communities.

What does the proposed changes look like?

    build: {
        publicPath: process.env.BUILD_PUBLIC_PATH
    },

And then set BUILD_PUBLIC_PATH to https://cdn.cmty.io on Heroku.

Additional: PWA + Workbox may help more improvements too :)

idea
2
Atinux
90
Atinux
commented 2 years ago

I thought about it as well, we have publicPath in Nuxt.js, so better use it 😄

I will implement it (as well I trying out nuxt-edge), thank you for this feature request :)

1
Informations
Feature RequestImplementing
#c14 - Created 2 years ago