I'm working on a Napili based community where we want to display images that are stored in SF Files to unauthenticated users. For example, we have some articles stored in custom objects (Knowledge for Lightning not quite meeting our requirements yet), each of which has an image file for its header. So, we want to make that image publicly available.
I've seen questions such as this:
Which works for logged in users, and is similar to my solution, but doesn't quite solve my issues.
My method was to make a Content Distribution for each image that we want to share. When an internal user uploads a File for use like this, a trigger creates the Content Distribution for them and saves the URL to the article record. The URL ends up being something like this:
Then, I can just use that as the src for an
This is bad for mobile users, and we suddenly have to care about the limit where only 20k downloads are allowed via Content Distribution per 24 hours.
I had a look at this question:
Which might give us an alternative to Content Distributions, but it would probably still be downloading the whole image every time for mobile users.
Is there a good way to deal with this scenario? We're looking at bringing in a CDN to do the caching for us. It seems like some of these issues are a bit new to SF communities, so there might not be an answer inside SF. I'm interested to hear of any approaches that people have used....