Images on webpage become broken after user is inactive >5min

When users have webpage open for awhile, all the images are broken… it looks like vercel does some type of image caching with timeouts.
All the document I read talks about image path etc but everything is correct and images renders fine in my local and in AWS. This behavior is only in Vercel.
Is Vercel web hosting not meant for commercial grade website? This is starting to be a deal breaker for me to stay with Vercel hosting my production website.

Its a reactjs web application. Open the site hosted on vercel and stay in active for >5 minutes. Begin navigating the site again to see broken images until manually referesh the browser.

Latst version of ReactJS

Hi @grumblegirl, welcome to the Vercel Community!

This sounds weird. Vercel is definitely capable of hosting commercial grade websites. Can you share the URL of the website so we can inspect as well?

Thank you Anshuman. URL is www.bltz.ai

When this happens, the browser console has many errors like this and it goes away when browser is force refreshed.

main.7e29364a.css:1 GET https://www.bltz.ai/static/media/cover4.a7fcdc6f8ed1fde54331.png 403 (Forbidden)Understand this error
main.7e29364a.css:1 GET https://www.bltz.ai/static/media/model_layers3.5e1603983bfabf0031cd.png 403 (Forbidden)Understand this error
main.7e29364a.css:1 GET https://www.bltz.ai/static/media/grey_background.39a5a32f9e695f628b02.png 403 (Forbidden)Understand this error
main.7e29364a.css:1 GET https://www.bltz.ai/static/media/cover4.80425ed043d363a9e34d.png 403 (Forbidden

Thanks for sharing these. Can you also share the tech stack your applications uses? Such as Next.js or Remix or something else.

The tech stack is ReactJS.

Okay. I tried recreating by staying on the website for 10 minutes and visiting different pages. I didn’t see broken images so far. It’d be great if you could share more precise steps for recreating the issue or a repository that has these issues.

HI Ashuman,

Thank you for looking into this. I’d say the best way is to have the site open without any activity for a while until session becomes stale and browse it again - unsure how many exact minutes on vercel.

Digging it a bit dipper in browser console, I see below static artifact structure (not my code structure/folder - what is created after react site deployment by vercel as a static media) and issue is on files in media folder. They get 403 forbidden when the user is inactive for whatever duration Vercel considers session is inactive.

Specific error on browser is "Failed to load resource: the server responded with a status of 403 ()”. On the surface level, it appears some sort of security feature from Vercel blocking image files in media folder no longer accessible to browser if vercel thinks the user session is no longer active? But for public website this is really bad, users should be able to have the webpage open as long as they need to whether they are active or not without all the images become broken on the site. This is why I am wondering if vercel is right solution for public/production websites.

Am I missing some settings for deployment to prevent this? I spent many hours googling and reading your doc site and have not found anything about this issue.

top
L www.bltz.ai
L static
L css
L js
L media

One more question - would the "Failed to load resource: the server responded with a status of 403 ()” error on static media fetch has anything to do with Vercel browser verification? When the images are broken due to the webpage open for awhile with no activity, when I force refresh, it shows “We are verifying your browser” then images are back to working again.

I am wondering if there is a time limit on how long Vercel consider the successful browser verification is applied, and when it expires it make the static images not accessible by browser. We just launched the website to social media and this issue is becoming a big deal breaker for us. Any support vercel can provide timely would be greatly appreciated.

I understand that this isn’t the ideal outcome. But, I am unable to recreate this myself.

May I know why the Attack Challenge mode is turned on your website? The reason it’s asking for user verification.

If it’s not needed anymore, you can try to turn it off and see if it solves your issue.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.