csfloat / inspect

Source Code that Powers the CSFloat Inspect Link API
https://csgofloat.com
MIT License
392 stars 118 forks source link

> > This is because we have very aggressive caching (kind of necessary for the prod API since we get 100 million+ requests per day). If we want to have sufficient speed (Valve's GC _is slower than our internal caches_) for the majority of requests, this is necessary. #208

Closed wangxingzhen closed 6 months ago

wangxingzhen commented 6 months ago
          > > This is because we have very aggressive caching (kind of necessary for the prod API since we get 100 million+ requests per day). If we want to have sufficient speed (Valve's GC _is slower than our internal caches_) for the majority of requests, this is necessary.

So, this is a known tradeoff between performance and freshness -- notably Valve is kind enough to not change the inspect URL at all when a sticker is scratched. Once a sticker is fully scratched, the URL changes and will cache bust on our end.

Whether it is possible to add a flag parameter that indicates whether to use caching by default or to call Valve directly

Or, if it has a sticker, don't cache it and just call Valve every time

Originally posted by @wangxingzhen in https://github.com/csfloat/inspect/issues/108#issuecomment-1968328069