-
Notifications
You must be signed in to change notification settings - Fork 9
Local monster data storage
Freddie edited this page May 4, 2014
·
2 revisions
Store monster data on the client instead of having a GIGANTIC data file (current size: 140,213 bytes).
- Don't need to redownload the huge JS data for relatively small changes.
- Mobile friendlier?
- 'Monster' actually needs to mean 'a whole lot of types of data' - evolutions and active/leader skills being the biggest contributors after monsters.
- Ensuring that versions get updated on every table could be interesting.
- Update the Monster table to include 'version' column.
- Update the import_monsters management command to set any new/updated monsters to MAX(version) + 1.
- On initial site load, check for monster data in the load_usermonsters() helper function.
- No data? Fetch full data from /some/uri/ THEN fetch userdata.
- Have data but version is old? Fetch /some/uri/7/ (data newer than v7), update data.monsters.
- Save data.monsters to localStorage as serialized JSON.