Score:1

Nginx performance issues

I made a website using React and connected to Strapi. But I need to keep some background videos mainly on the home page. The main banner has 4 videos and the background of the page is also a video. The site was very heavy and overloaded, but the customer wants to continue with the background videos in infinite loop and autoplay. Is there any way to configure nginx to compress or add to cache, or optimize the loading of videos?

cn flag
Why would you care? I mean, why do you not offload assets to a CDN so they do not come from YOUR server (or put something like cloudflare in front)? Also, why use a web server. And what compression do you expect - unless you bonkert is brutally, videos are already compressed with video compression. Nothing to not a lot would be gained from standard compression.
Score:0
br flag

Once the video's downloaded the browser should just repeat playing it from its cache - you have a few options;

Make the video smaller - either by making its dimensions smaller, compress it more or use a better codec.

Increase the performance of the server - more/bigger-CPUs, more memory if you're low on that (as it'll use the memory to cache the videos).

Add more servers (behind a LB of course).

Use a caching service like akamai etc. to host the videos.

cn flag
last point: run all traffic through cloudflare that should do that auomtically without hosting on a separate caching service.
Score:0
bt flag

You should pay attention to compression of the video files before they get given to nginx to serve, but nginx can't compress those better than your video software.

Delivering your media files via caches close to users might help (cloudflare and akamai have been suggested by others here, andthey are the big players).

Pay attention to caching flags on your media files. That will help browsers pages with the videos are loaded more than nce by the same browser, and will also help any intermediary caches to not have to check again with the origin server before serving the file.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.