LP#1848550: client-side caching of org settings for AngularJS
authorJeff Davis <jeff.davis@bc.libraries.coop>
Wed, 27 Nov 2019 00:12:37 +0000 (16:12 -0800)
committerBill Erickson <berickxx@gmail.com>
Thu, 26 Dec 2019 16:59:49 +0000 (11:59 -0500)
commitbcbdee92b56e16b610a43ab4137bf0cc1a128615
treef7a25c47fb72ce1879bb6ee0d070fa0b5adbc084
parent29d5c4e35c1a09e20c0db114c9ad5d18b9c9aae7
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.

The settings cache is cleared on login to ensure stale values don't
stick around forever.  To refresh the cache, simply logout and then
login; cached values will be deleted and the latest values will be
retrieved from the server when they are needed.

Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/staff/services/auth.js
Open-ILS/web/js/ui/default/staff/services/lovefield.js
Open-ILS/web/js/ui/default/staff/services/org.js