LP#1848550: client-side caching of org settings for AngularJS user/jeffdavis/lp1848550-cache-settings
authorJeff Davis <jeff.davis@bc.libraries.coop>
Wed, 23 Oct 2019 23:25:41 +0000 (16:25 -0700)
committerJeff Davis <jeff.davis@bc.libraries.coop>
Tue, 29 Oct 2019 23:24:58 +0000 (16:24 -0700)
commite528125b062e70cc404d9d5625074c12b91bc85d
tree704a6afc5e709dc99a80711db747e6074044ccbb
parent11868e97844a47d57489062197ac6809d9473366
LP#1848550: client-side caching of org settings for AngularJS

The web client almost always does live lookups any time it needs to
check an org setting.  But these settings rarely change, so it would
make sense to cache them.  They're already cached using Lovefield in
order to support offline; this commit checks the cache first, and only
does a live lookup if the setting is uncached or expired (i.e. added to
cache more than 12 hours ago).  Offline ignores the 12-hour expire time
so that we always have settings to work with when the server is
unreachable.

Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop>
Open-ILS/web/js/ui/default/staff/offline-db-worker.js
Open-ILS/web/js/ui/default/staff/services/lovefield.js
Open-ILS/web/js/ui/default/staff/services/org.js