Jessecar96 / SteamBot

Automated bot software for interacting with Steam Trade
http://scrap.tf
MIT License
1.33k stars 910 forks source link

Cache the Item Schema. #103

Closed cwhelchel closed 11 years ago

cwhelchel commented 11 years ago

Everytime I download the tf2 item schema it seems to take quite a while. We should cache what is downloaded to a file and reuse that on next launch. When the schema gets updated, only then download it again. Rinse and repeat.

This seems to indicate that we can check the schema version by checking some headers with the schema request.

teliosdev commented 11 years ago

If you make a HTTP HEAD request, it should just give the headers.

Scratch that, it doesn't seem to work with this.

lazy1 commented 11 years ago

I added Schema caching to Schema.cs. Please take a look: https://github.com/lazy1/SteamBot/commit/09efa4fa7e92d3189c27a59f6be107c1fa098dfd

cwhelchel commented 11 years ago

@lazy1 That looks like it worked for me. A few points, however; the name of the cache file should probably indicate the game since others are doing Dota 2 stuff. Also the indentation seems messed up in the else block.

Do a pull request so this can get added.

//cc @redjazz96