make FS cache re-check with server once per week
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenSatNav |
Fix Released
|
Medium
|
Guillaume Rosaire |
Bug Description
Normally when you think of a web cache, you imagine that you get a fast load time from local storage, but that at some point the cache will expire and you'll check against the server for updated information. Under the old tile cache code this was never happening: if the FS contained a tile then it would be displayed. This meant that any updates you made to OSM would never make it to your OSN display.
This patch fixes that problem. It updates the DB scheme to also store the date the tile was last checked against the server. If that was less than a week ago, then the cached tile is used. If it was more than a week ago, then the cached tile is displayed immediately, and the server is checked for an updated tile in the background. When the server responds, the disk cache is updated and then the display is updated.
This patch introduces a slight flicker when an old tile has already been displayed and it is updated to a new tile. Its minor and only happens once per week for any given tile.
As I only wrote this today, I obviously haven't tested it for a week. :) I did force some of the tests to true to test other code paths, but I may have missed something.
This is something I've mentioned on the lists and is a welcome addition.
Thanks,
Chris.