zarqon
Well-known member
There are quite a few commonly-used scripts that search for mall prices on a list of items -- CounterChecker, Universal Recovery, networth.ash, PriceAdvisor, probably EatDrink (haven't used it), to name a few. I also have a few daily utilities that do this -- my daily consumption script, and my "profitable zap" script.
The way mall_price() currently works, it will hit the server once per session per item. This is nice to KoL's servers.
I'm proposing to make it much nicer. If I call mall_price() 4 hours after the first call but in the same session, it uses the cached result. However, if a concurrent instance of mafia calls mall_price() just seconds after the original call, it will still hit the server because it's not in the same session.
Can we share the mallprice cache across mafia instances, making the expiry time-based rather than session-based? If I left mafia unattended for most of the day and came back, I'd want fresh mall prices. Likewise, if I'm running multiple mafia instances I don't need it to hit the server twice just seconds apart. I suggest an expiry time of 2 hours, but that's certainly up for discussion -- it could also be a preference.
This proposal would save literally tens of thousands of server hits. Probably millions, eventually.
The way mall_price() currently works, it will hit the server once per session per item. This is nice to KoL's servers.
I'm proposing to make it much nicer. If I call mall_price() 4 hours after the first call but in the same session, it uses the cached result. However, if a concurrent instance of mafia calls mall_price() just seconds after the original call, it will still hit the server because it's not in the same session.
Can we share the mallprice cache across mafia instances, making the expiry time-based rather than session-based? If I left mafia unattended for most of the day and came back, I'd want fresh mall prices. Likewise, if I'm running multiple mafia instances I don't need it to hit the server twice just seconds apart. I suggest an expiry time of 2 hours, but that's certainly up for discussion -- it could also be a preference.
This proposal would save literally tens of thousands of server hits. Probably millions, eventually.