Question

How to serve videos from Digital Ocean?

I am using an Express App with Create React App. I want to serve videos for an education website but restrict access to users only logged in.

My understanding is I can use a digital ocean space to serve content through a CDN using an API key. So my server would make the request with the API key.

Then serve the content to the client. What I am not sure about is what is the point of having a CDN if the content is downloaded to the server and sent to the client. Can you have the content go straight from the CDN to the client?

Without having to store the API key in the front end?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey there!

The CDN feature of Spaces would distribute those video files from multiple locations, thus decreasing load times for your users. You could serve those videos directly from the Space rather then fetching it to the server then to the client. Rather then using a API key to access those videos you may be able to configure CORs access for your domain. This could then allow access as needed. If that won’t work for your setup though you would need to use the key and this wouldn’t necessitate the need of the CDN as your server would be pulling the video each time.

Hope it helps! Nate