# How to collect all static assets (js, css) used by discourse

**URL:** <https://meta.discourse.org/t/how-to-collect-all-static-assets-js-css-used-by-discourse/149319>\
**Category:** Support\
**Created:** [April 26, 2020, 8:09am UTC](https://meta.discourse.org/t/how-to-collect-all-static-assets-js-css-used-by-discourse/149319 "2020-04-26T08:09:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Windsooon](https://avatars.discourse-cdn.com/v4/letter/w/c2a13f/32.png) [@Windsooon](https://meta.discourse.org/u/Windsooon)\
**Post date:** [April 26, 2020, 8:09am UTC](https://meta.discourse.org/t/how-to-collect-all-static-assets-js-css-used-by-discourse/149319/1 "2020-04-26T08:09:29Z")

</div>

I’m trying to setup CDN for my forum. since China banned [Fastly](http://www.fastly.com/) 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:

` /var/www/discourse/app/assets`

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

1. How to generate the hash file name?
2. Any other way to collect the static asserts?

---

_[View the full topic](https://meta.discourse.org/t/how-to-collect-all-static-assets-js-css-used-by-discourse/149319)._
