Multiple caching operations to support offline execution
Techniques for caching for an application executable on a mobile device, where the application has a user interface that includes a set of templates specifying data fields that reference record data from a database. The application is executable when the mobile device is online to communicate with an application server to access sufficient record data to fully render templates for those portions of the user interface selected by a user. The set of caching operations can include a record caching operation that caches records according to a default and/or custom set of rules for all versions of the application; a template caching operation that causes selected template data to be cached; and a template-record caching operation that causes a set of record data to be cached such that templates for the cached selected template data will fully render offline for a specified set of records.
1 . A non-transitory computer-readable medium storing program instructions that are capable of being executed by a computer system to perform operations, the operations comprising:
operating an application server operable to handle calls made from a particular version of a remotely executing application, the particular version having a user interface that includes a supplemental portion based on a set of templates customized for a particular one of a plurality of organizations;
storing record data in a database;
storing template data in the database for the set of templates, a given template of the set of templates specifying data fields for that template and being fully renderable by the particular version, while executing on a mobile device that has a network connection to the application server, by populating the specified data fields with record data from the database;
receiving a request to cache data for the mobile device; and
in response to the request, performing a set of caching operations that includes:
a record caching operation that causes a baseline of record data having a set of records to be cached at the mobile device according to a default set of rules that apply to all versions of the application, wherein the record caching operation also caches records according to a custom set of rules that override any conflicting rules in the default set;
a template caching operation that causes at least a subset of the set of templates to be cached at the mobile device; and
a template-record caching operation that causes additional record data for the particular version to be cached at the mobile device such that the subset of templates will fully render when the mobile device does not have a network connection to the computer system.
2 . The non-transitory computer-readable medium of claim 1 , wherein the additional record data and the template data are data of the particular organization.
3 . The non-transitory computer-readable medium of claim 1 , wherein a native portion of the user interface is programmed using a first programming language and wherein the supplemental portion of the user interface is programmed using a second, different programming language.
4 . The non-transitory computer-readable medium of claim 1 , wherein the template caching operation causes a total number of templates in the supplemental portion of the user interface for the particular organization to be cached at the mobile device.
5 . The non-transitory computer-readable medium of claim 1 , wherein the set of records are those records of a particular set of types having time values within a specified time range.
6 . The non-transitory computer-readable medium of claim 1 , the operations further comprising:
storing behavior data indicative of data selections made by one or more users of the application; and
when performing the template-record caching operation, selecting the additional record data based on a recommendation from a machine-learning model trained using the behavior data.
7 . The non-transitory computer-readable medium of claim 6 , wherein the data selections include report-generating commands issued by users via the user interface on the mobile device, and wherein the behavior data for a particular report-generating command includes a corresponding record and template.
8 . The non-transitory computer-readable medium of claim 6 , wherein the subset of templates includes templates recommended by the machine-learning model.
9 . The non-transitory computer-readable medium of claim 1 , wherein the template-record caching operation includes crawling the set of records to identify data dependencies and caching any additional records indicated by the identified data dependencies to ensure that the subset of templates will fully render when the mobile device is offline.
10 . A method, comprising:
performing a set of caching operations for a particular version of an application executable on a mobile device, the particular version having a user interface that includes a native portion and a supplemental portion, the supplemental portion including a set of templates that is customized for a particular one of a plurality of organizations, the set of templates specifying data fields, the application being executable when the mobile device is online to communicate with an application server to access sufficient record data to fully render templates for those portions of the user interface selected by a user, the set of caching operations including:
a record caching operation that causes a baseline of record data having a set of records to be cached at the mobile device according to a default set of rules that apply to all versions of the application, wherein the record caching operation also caches records according to a custom set of rules that override any conflicting rules in the default set;
a template caching operation that causes at least a subset of the set of templates to be cached at the mobile device; and
a template-record caching operation that causes additional record data for the particular version to be cached at the mobile device such that the subset of templates will fully render for when the mobile device is offline.
11 . The method of claim 10 , wherein the set of records are those records having a time value within a specified time range.
12 . The method of claim 10 , wherein the template-record caching operation includes crawling the set of records to identify data dependencies and fetching any additional records indicated by the identified data dependencies to ensure that the subset of templates will fully render when the mobile device is offline.
13 . A method comprising:
operating, by a computer system, an application server configured to handle calls made from a particular version of a remotely executing application, the particular version having a user interface with a native portion and a customized supplemental portion that is customized for a particular one of a plurality of organizations;
storing, by the computer system:
record data in a database; and
template data for a set of templates corresponding to the customized supplemental portion of the user interface, a given template of the set of templates specifying data fields for that template and being fully renderable by the particular version, while executing on a mobile device that has a network connection to the application server, by populating the specified data fields with record data from the database;
receiving, by the computer system, a request to cache data to the mobile device;
in response to the request, performing, by the computer system, a set of caching operations that includes:
a record caching operation that causes a baseline of record data to be cached at the mobile device according to a default set of rules, wherein the record caching operation causes record data to also be cached according to a custom set of rules that override any conflicting rules in the default set; and
a template caching operation that causes at least a subset of the set of templates to be cached at the mobile device; and
a template-record caching operation that causes additional record data for the particular version to be cached at the mobile device such that the subset of templates will fully render when the mobile device does not have a network connection to the application server.
14 . The method of claim 13 , wherein the application, including the native portion of the user interface, is available for use by users of a plurality of organizations, wherein the supplemental portion of the user interface is available for use by only users of the particular organization, and wherein the template caching operation causes template data for all templates of the particular organization to be cached.
15 . The method of claim 13 , wherein performing the template-record caching operation includes:
accessing a value indicative of a selected set of records, each of which specifies a corresponding one of a set of templates;
retrieving record data for the selected set of records; and
for each of the selected set of records, cache a corresponding template for that record along with any other record data for the specified template.
16 . The method of claim 15 , wherein, for a particular one of the selected set of records and a corresponding template, the corresponding record data includes all data from one or more other dependent records referenced by the particular record, such that the corresponding template will fully render for the particular record.