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

Level Progress Visualizer: fix bug that doesn't store cache properly #1662

Closed
cassolv opened this issue Nov 9, 2020 · 3 comments
Closed
Labels
Milestone

Comments

@cassolv
Copy link

cassolv commented Nov 9, 2020

I have noticed that the 1.20 Level Progress Visualizer feature sends a request to the user's page (e.g. steamgifts.com/user/yourusername) on, at least as far as I can tell, every page load. From what I understand, it is doing it to update the estimated level, in which case I expect that, if the user has e.g. 180 ongoing giveaways (say, for instance, when they're running a lengthy train), it will load up to page 8, thereby producing eight requests. On the assumption that this is indeed happening on every manual page load, if that hypothetical user a mere handful of pages, that feature alone will already hit ESGST's self-imposed per-minute limit. That is less than ideal.

While I can easily appreciate that poking the user page every now and then to update the estimated level can be necessary, doing so on every page load is not. To solve that, I think the estimated level should be cached aggressively and updated only in two circumstances: when the user creates a giveaway and otherwise once in a given time frame; once per hour is probably fine, but I'd even go with once per day.

@cassolv cassolv changed the title Level Progress Visualizer: cache estimated level and make estimated level optional Level Progress Visualizer: cache estimated level Nov 9, 2020
@rafaelgomesxyz
Copy link
Owner

It's actually always just one request to the /user/username page to get the user's CV, so the number of ongoing giveaways a user has is irrelevant.

And are you positive that it does so on every page load? Because it should only do it when the user's level changes.

@cassolv
Copy link
Author

cassolv commented Nov 10, 2020

Yeah, it was making one request on every load (or at least on more than 90% of them, during my short test). Within a couple of minutes, I made like twenty-ish requests to a handful of different pages and I had a comparable of requests to that page in the log. When I turned it off, those requests stopped happening, and when I turned it back on, they returned, so I'm pretty sure that this feature is related to them in some capacity (if not by directly making the requests, than possibly via interference with something else?). For now, I'm keeping it off altogether.

Also, if it should only do it on level changes, the rationale for #1663 becomes kind of moot, so as far as I'm concerned that becomes unnecessary; your call on whether it remains relevant as a feature on its own right.

@rafaelgomesxyz rafaelgomesxyz changed the title Level Progress Visualizer: cache estimated level Level Progress Visualizer: fix bug that doesn't store cache properly Dec 1, 2020
@rafaelgomesxyz rafaelgomesxyz added this to the v8.8.6 milestone Dec 1, 2020
@rafaelgomesxyz
Copy link
Owner

Oh, I found the error.

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

No branches or pull requests

2 participants