-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🎲 No Randomization on different endpoints #4
Comments
Here's what I have thought. Example![Jokes Card](https://readme-jokes.vercel.app/api?piyushsuthar) This will make each request unique. |
Good idea @PiyushSuthar, will work on it, also, I'm thinking of customization parameters too, like in github-readme-stats |
Could try to solve this problem, if no one is actively working on it. |
You can work on it @karmanya007 I can assign it to you. |
Bro do you want to get a new joke every time you GET the /api endpoint?? |
Or do you want some caching time? |
@karmanya007 both would be fine, |
Right now I have implement a cache age of 60 seconds i.e the jokes update after 60 seconds of reloading the endpoint. If you want I can keep this logic or make the cache age to 0. |
Keep this logic, we can set the cache age to any desired value, right? |
Yup. |
Cool, then I think it should be good, ensure that it'll work on vercel instance after production and then open up a PR, I'll merge. |
Works on the Vercel instance. PR opened. |
@karmanya007 I think randomization is not working, or is it working after 60 seconds? |
after 60 seconds |
@karmanya007 nice work. |
This issue is fixed, right? |
@karmanya007 no, not really, this issue is for serving different endpoint requests for different users, they should get different jokes each time also, theming is going to be added soon so that would have to address this issue itself. You solved #2 |
@ABSphreak If everyone creates there own vercel instance, then this issue would be fixed. (Like in the github-readme-stats) |
@karmanya007 point of this project is to provide a customized readme-joke card, even if the user doesn't have the knowledge of Vercel or serverless. The solution is simple, as pointed out above by Piyush, please read message threads and follow github-readme-stats for more details, it has many users, Vercel deployment instructions are for people who want to develop over it or don't want to use the default endpoint provided by the repo, so those people can create their own Vercel instance and play with the project to suit their needs. Also, not many people would create a Vercel instance just for serving jokes, LoL. |
I think i can implement this feature. |
@karmanya007 go ahead, try it. I'm just not very active on this repository, but I am watching all the contributions on it. |
The request I make on my pc gives me different jokes as compared to the jokes i get on my phone. Is this what you wanted? |
@karmanya007 yes. |
But the thing is, I didn't change anything in the code. This is what I was talking about before. |
@karmanya007 Try hitting this endpoint in two different tabs https://readme-jokes.vercel.app/api, Endpoint requests are not unique. I want something like: both unique endpoints serving different kinds of data. Also, if you check my Profile README & endpoint at the same time, it's showing different results, so maybe it's working? 🤔 |
@ABSphreak On the same device, the jokes are same but on requests from different devices the endpoint get different data. |
@karmanya007 okay, then I think we should close this one and open a new one for making endpoints get user inputs I guess. |
Yup |
Jokes are not randomizing on different endpoint requests.
The text was updated successfully, but these errors were encountered: