Skip to content
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

Investigate longer cache times #66

Open
JamsheedMistri opened this issue Dec 31, 2022 · 15 comments
Open

Investigate longer cache times #66

JamsheedMistri opened this issue Dec 31, 2022 · 15 comments

Comments

@JamsheedMistri
Copy link

JamsheedMistri commented Dec 31, 2022

The user d659e53b3f9e4488818fa2d0732789ae changed their username to jji 4 days ago (Dec 26), but the API is currently returning their old username, Dxw (link). Querying jji will result in a 404 (link).

I inspected your code and it seems like the cahce TTL is only 1 hour for this endpoint, so idk why it would be out of date by 4 days.

@Electroid
Copy link
Owner

Hi, taking a look at the issue

@Electroid Electroid changed the title Incorrect information returned from API Investigate longer cache times Jan 1, 2023
@Electroid
Copy link
Owner

The cache TTL has been fixed, names and profiles should be properly updating now.

@andreasdc
Copy link

andreasdc commented Jan 1, 2023

What's the cache time right now? If it's 1 hour is still pretty long.

@JamsheedMistri
Copy link
Author

@Electroid the longer cache time issue seems to still be persisting. User k5s registered an account more than 1 hour ago, but querying their username (link) gives a 404. Querying their UUID works though (link).

@Electroid Electroid reopened this Jan 3, 2023
@JamsheedMistri
Copy link
Author

JamsheedMistri commented Jan 3, 2023

@Electroid additionally, querying user 4bk yields a user whose name was previously 4bk but is no longer. It shows their new username on the response. The name change was around 17 hours ago. (link).

@andreasdc
Copy link

I think cache time is set to 60 hours

@Electroid
Copy link
Owner

Right now it's a random time between 1 and 24 hours. This is obviously not great, but otherwise there are too many 429 errors and nothing can get updated.

I've been working on a rewrite, since December, which is able to get around these limitations. It's about a week or two away from being rolled out. After that, the cache time will be about 5 minutes.

@andreasdc
Copy link

You have a backup server that you mentioned some time ago, 429 errors depend on cloudflare itself too, but caching 1 player for such a long time is not a good solution.

@Electroid
Copy link
Owner

There is so much volume, even the backups (there are multiple servers) are getting rate limited. As I said, this is a temporary solution until the new system is rolled out.

@JamsheedMistri
Copy link
Author

Right now it's a random time between 1 and 24 hours. This is obviously not great, but otherwise there are too many 429 errors and nothing can get updated.

I've been working on a rewrite, since December, which is able to get around these limitations. It's about a week or two away from being rolled out. After that, the cache time will be about 5 minutes.

Looking forward to the rewrite! Out of curiosity, how's it being done? Are you just upping the amount of requester nodes and doing a round-robin style? Is there a branch we can see the progress on?

@andreasdc
Copy link

andreasdc commented Jan 3, 2023

Maybe create a password type of key to limit some users which may make too many requests.

@JamsheedMistri
Copy link
Author

@Electroid Any update on getting the new API rolled out?

@CraftedFury
Copy link

@Electroid Any progress on the updated API?

@ismhdez
Copy link

ismhdez commented Mar 23, 2023

The TTL must be too high, an account created on Mar 18 is still appearing as 404 Not Found on 23 Mar 😵‍💫🤔

@samfces
Copy link

samfces commented Jun 13, 2023

We are having the same problem. An account changed his name two weeks ago and account still appears as 404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants