isCacheSyncRequest() and setCacheSyncStrategy()

SmartClient Version: v13.1p_2026-09-26/Enterprise Deployment

Hi, I’ve a custom DataSource extending SQLDataSource whose executeFetch() does some expensive work.
During the cache sync fetch that follows an add/update this work isn’t needed, so I skip it using dsRequest.isCacheSyncRequest(), which works but isn’t in the Javadoc.
Is it safe to use it? Or is there a supported way to recognize a cache sync fetch?

Similarly, DSRequest.cacheSyncStrategy is documented client-side, but setCacheSyncStrategy() on the server-side DSRequest isn’t, although getCacheSyncStrategy() appears in the code sample of the cacheSynchronization topic. Is it meant to be supported?

We’ll check on the docs because definitely anything used in a sample is supposed to be a supported API. You are definitely allowed to set cacheSync strategy on an operationBinding:

https://smartclient.com/smartclient-latest/isomorphic/system/reference/?id=attr..OperationBinding.cacheSyncStrategy

.. and a dynamic call should be fine as well, but we’ll need to document when it’s allowed to be called vs is too late.

As far of the broader question, you can use operationBinding.cacheSyncOperation if you have an inexpensive way of providing cache sync data that isn’t one of the built-in cacheSyncStrategy choices.

 https://smartclient.com/smartclient-latest/isomorphic/system/reference/?id=attr..OperationBinding.cacheSyncOperation

Thanks. About DSRequest.isCacheSyncRequest(): is it safe to rely on it?

A dedicated cacheSyncOperation would work, but it has to be declared on every add/update binding of every DataSource that uses our class, and we can’t check that at runtime.

In our case the cache sync data is the default fetch: we only need to skip the extra work in executeFetch().