X

The Visual Builder Cloud Service Blog

Business Object Client Side Caching with Visual Builder

Shay Shmeltzer
Director of Product Management - Oracle

If you are using Visual Builder's Business Objects (BO) as a source of data for your Visual Builder user interface, caching their content on the client side can help improve your app performance. The latest version of Visual Builder provides a simple declarative way to control caching settings for your BOs.

Caching Considerations

There are a couple of points to consider before you implement caching though:

If your data is frequently changing, you might not want to cache it on the client as the cached data might be out of date when the user access it. For example, we wouldn't suggest caching the current inventory for each product in your warehouse, as this will change with every new order placed. The list of product names, however, might be data that you can cache assuming your products catalog changes at most once a day. Visual Builder lets you define the length of time that the data is cached - which should help you tune this for each piece of data.

The other thing to keep in mind is that the data is cached on the browser's disk cache - which means that someone who gets access to this cache can get access to the data. So, if your data is sensitive from a privacy perspective, think twice before you allow caching.

Caching Configuration

If you decided that caching is a good solution for your use case, you can easily turn this on for specific business objects. The setting is found in the "End Points" tab of your business object under the "Resource Cache Control" section.

You'll find 4 options for settings. The default is "Sensitive" that indicate data should not be cached but rather fetched each time. The next two options are "public" and "private" that differ in where they allow data to be cached. Both allow caching in the browser's client, but the public option also allow caching in other layers such as the internet provider's servers. Both will let you set the length of the caching period to indicate when a refresh of data is needed. The fourth option - "custom" - gives you full control on the exact settings you want to have.

Note that the caching setting will only apply to your application when it is staged or published - it won't take effect when you preview your app from the IDE. You can see the caching in action by looking at the network traffic monitor in your browser's development tools.

Here is a quick demo of the settings and the effect they have on your network traffic:

Join the discussion

Comments ( 2 )
  • Oliver Funk Friday, May 7, 2021
    Is it possible to provide the same level of caching for REST endpoints as well?
  • Shay Sunday, May 9, 2021
    Oliver - your REST service will need to set the cache control header returned to VB.
    If it doesn't set caching and you still want to cache data on the client - have a look at the Oracle JET offline persistence utility and using it in VB.
    This will let you code caching on the client of data.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.