Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Use SQLite to cache resources #450

Merged
merged 40 commits into from
Oct 1, 2014
Merged

Use SQLite to cache resources #450

merged 40 commits into from
Oct 1, 2014

Conversation

kkaefer
Copy link
Contributor

@kkaefer kkaefer commented Aug 25, 2014

Implement part of #446:

SQLite-related tasks:

  • Store expiration date
  • Store resource type
  • Perform conditional GETs if we already have the data, but it's expired
  • Update tiles after their expiration date (first, show old tile, load new tile (if network available), store it in DB, and update the displayed tile)
  • Make querying asynchronous
  • Implement database size limit
  • Compress data stored in database (zlib? snappy? lz4?)
  • Store database in correct location (use platform:: callback to determine)
  • Remove access_token from URLs before storing them in the database
  • Measure SQLite query performance
  • Store non-200 results
  • Handle corrupt databases
  • Add offline-only mode

@kkaefer kkaefer force-pushed the caching branch 2 times, most recently from 1aeae0b to 74221f2 Compare August 25, 2014 12:07
@kkaefer kkaefer changed the title 446 #446 Aug 25, 2014
@kkaefer kkaefer changed the title #446 Use SQLite to cache resources Aug 25, 2014
@incanus
Copy link
Contributor

incanus commented Aug 25, 2014

Just capturing from chat with @kkaefer — we want to ensure the ability to plug in varying cache-backing files (doesn't have to be simultaneous). This way we can ensure predictability when saving "offline documents" but later updating individual tile URLs used by the normal system or other documents.

instead of waiting until all threads have joined, we are now supplying a callback that will be invoked once all threads have terminated. you can use this callback to free the worker struct
@kkaefer kkaefer merged commit 708194c into master Oct 1, 2014
@kkaefer kkaefer deleted the caching branch October 1, 2014 16:09
roblabs added a commit to roblabs/mapbox-gl-native that referenced this pull request Aug 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants