High bandwidth consumption even with local media saving script at deploy

Hi,
We developed a year ago keepgrading.com using Prismic CMS. The site grow a lot since then with a lot of media in it and we got a lot of high consumption spikes over the months.

Since our client is a small business, he can't really afford a medium plan at $100/m and even if he can there would not be enough bandwidth for our use case (we once went up to 2TB). So we created a little deploy script which is saving locally on a VPS the media used in the website, and updating only media that aren't saved for future deploy.

This solution is now online for more than 2 weeks but we still are getting between 5 and 10gb daily bandwidth consumption which doesn't really make sense right now. We thought that maybe DNS weren't updated since we change the hosting from Netlify to a VPS, but I think 2 weeks is enough for DNS updates. Browser cache should also already been updated at that time. Do you have any clue or information to give us about this issue?

Thanks a lot!

Hi, @fxmanceau.

Welcome to the community, and thanks for reaching out to us!

My apologies for my late reply. I will look into this and reply when I have news.

Thanks,
Racheal.

Hey, thanks!
Waiting for some information then.

Hello @fxmanceau,

This happens when your CDN bandwidth consumption exceeds the quota included in the free plan (100GB/month) if that's the plan you are on. If you are in this situation, please upgrade to one of the paying plans from the Plans & Billing section of your Repository settings. This is a mandatory step to ensure service continuity for the Content Delivery API of your Repository.

But as you mentioned, you implemented a workaround for your use case. No news about this yet, but I will update you when I do.

Also, are you using the cdn endpoint?

Thanks,
Racheal.

Hey @racheal.orukele,

Indeed we know this happens because we exceeds the free quota. My client can't pay $100/m of subscription so that's why we created a workaround.

I'll wait your updates then.

We are not using the cdn endpoint on this version. Will that help?

The CDN is always recommended to use the endpoint because it is cached and always faster.

The way it works is if the Prismic master ref is old, then there’s a good chance that your request is cached. When you create a new ref, publish a change, and your API updates, it clears that cache.

So the first time you make any given request, it will make a call to the server, and it’ll run the request and return. From that point on, if you’re using the same ref and making the same request, it will give you the cached version and do that for all requests.

So, using the CDN after you’ve done the first request of any kind, it’ll be much faster to use and won’t consume your bandwidth on the Prismic side.

So we activated the CDN in the beginning of the week, but I don't think this will changed much since the bandwidth usage rely more on media than CMS data. We're using Nuxt with full static generation so we only call Prismic once.

We're still having a lot of data used per day (between 5 and 10gb) and right now I really don't understand what is going on since all of our media links are replaced by local links to saved media (there is literally no prismic url in the generated htmls) and users cache should already be expired.

Hello @fxmanceau,

My apologies for the late response.

I got feedback from our team that you have a large mp4 file with multiple requests generating high bandwidth; I shared the link to the mp4 file via DM. I suggest you compress the file before uploading it to Prismic and replace the media item in your document.

Can you give me more information about the build script that was deployed? It seems to me that media is already uploaded to Media Library.

Thanks,
Racheal.