I’m trying to setup CDN for my forum. since China banned Fastly and lots of CDN servers, so I can’t use them to speed up my forum. After doing some research, I turn to Jsdelivr, which can serve static files from npm or Github repo.
I know I can use DISCOURSE_CDN_URL in app.yml to set up the URL. But before that, I have to collect all the static files (js, CSS) from my forum then upload it to Github so Jsdelivr can access them. I found the static files actually located inside the docker container:
So I’m thinking of copying all the files from this path every time after I rebuild the app then upload them to Github, I guess this idea should work, but the actual request contains a long hash name which I don’t know how to get it. For instance,
ember_jquery.js will become ember_jquery-8ef4e572f0bf9485e6ef9a35f088729735f82434cf495fbcd5acedefbcddb363.js
So my question is
- How to generate the hash file name?
- Any other way to collect the static asserts?