groktruth
groktruth
CDCloudflare Developers
Created by groktruth on 3/24/2024 in #general-help
Nextjs's Images component is blocked by Cloudfare R2
Hi guys, i run into some troubles when configuring R2 with Vercel image optimization. So i stored my images in r2 and that bucket connects to my domain, which means it refuses to serve from all other domains but mine. But in my nextjs app, i am using Image component from nextjs that makes a request from, i dont know, maybe vercel's server, and it is blocked. I try to configure the CORS of my bucket like allows headers that have user agent, but it still doesnt work. Any ideas? Thanks
4 replies
CDCloudflare Developers
Created by groktruth on 3/3/2024 in #pages-help
Cloudfare R2 mismatches between 206 and 200 status code
I use cloudfare r2 to store and stream videos for my website. When i first play the video, the video works fine but when i forward to some point of the video, it restarts the video, playing from 00:00. The workaround is to reload the page, which is ofc not good for user experience. When i investigate the network log, i found out that the first time playing the video, the status code is 200. After reload the page, the status code is 206 - partial content. The issue gets worse once after i reload the page. When i try to seek to some points of the video, some of the requests are 206, but some are 200, which forces to download the large chunk of video in between. Is there a way to always make 206 requests to cloudfare r2. I am using Nextjs and videojs for streaming.
4 replies