How to set S3 only save user upload files

Hello, I would like to use S3 to only save my uploaded file and I don’t want to save my assets(like js) to S3.

Is there anyway to do it?

What problem are you solving?

I think if you don’t set use_s3 then it might not upload assets, but I’ve not done that in years. It’s not supported and is likely to cause problems.

My discourse server/users are in Asia, and I am using backblaze B2 as my S3 solution.(becasue it’s cheap)

The problem that is I don’t want to save js files to S3 and let my users to load it, becuase I am thinking it will slow the site loading file.

So I would like to know if there are anyway to only S3 to store upload file.

That’s the way that all hosted discourse sites work.

You’re using a cdn, right? It’ll be faster than your site.

Yes, I am using cdn for S3.

But I still wondering, if
does discourse server(asia) → cdn → users(asia) faster than S3(US) → cdn → users(asia)?

I saw there is a parameter named DISCOURSE_S3_UPLOAD_BUCKET, it looks like a solution to me but after I replace DISCOURSE_S3_BUCKET by it. I cannot rebuild my discourse

The cdn is faster.