vercel / react-tweet

Embed tweets in your React application.

Home Page:https://react-tweet.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

404 error: https://react-tweet.vercel.app/api/tweet/{tweet_id}

takabinance opened this issue · comments

Today the api stopped working for me. It had been working for days.

Funny enough, the demo id (https://react-tweet.vercel.app/api/tweet/1629307668568633344) still returns data but maybe cached somewhere?

e.g.,
Request URL: https://react-tweet.vercel.app/api/tweet/1736135372386484521
Request Method: GET
Status Code: 404 Not Found
Remote Address: 76.76.21.98:443
Referrer Policy: strict-origin-when-cross-origin

And now it works. Sigh. Just to set expectations, is there any sense for how often this happens (trying to figure out if I need to create some sort of backup strategy if this happens again).

The reason this is likely happening is Vercel being rate limited by Twitter. It's intended for the Twitter API we use to work in most scenarios but because Vercel's IPs are making a considerable amount of requests in the server they're being rate limited.

The solution I'm thinking right now is to implement caching and to fallback to client-side data fetching if necessary. Caching will work very well if enabled during development as those requests will come from your machine.