Rest-erp and caching

I’m making 5 back to back rest-erp calls to retrieve information based on the current matched row in the grid. I’m calling the Ice.BO.DynamicQuerySrv and I’m passing in different Execution Parameters for each call. However, all of the responses are returning exactly the same response and it shouldn’t. I tested the same 5 rest-erp calls one at a time using Postman and I clearly see different responses.

This smells like a caching issue. Is it possible that the caching mechanism is not looking at the Execution Parameters and it’s assuming it already has the correct response?

For clarity, I have a grid with on average 5 rows and I need to update two columns per row that will have different values based on other key values within those fields.

Is there any way to tell the resp-erp component to temporarily turn off caching?

Not sure if you’re in Classic or Kinetic, but in App Studio…

Without knowing more about what you’re doing/calling, etc. this setting came to mind. This is on the Response Parameters where you can either merge the response with (I’m assuming, previously returned data) or “replace” the previously returned data with the newly returned.

Have you played with that setting at all? I’m not sure what the “default” merge behavior is, if you don’t select something here. Curious if you set this to replace if you may get better behavior for your particular use case.

Are you seeing the different execution parameters in the network trace? Not in postman, I mean in the application itself. Maybe there is a problem with the iterative event.

I’m using Kinetic 2022. I tried both merge and replace. When neither worked, I enabled developer tools in Edge and looked at the network traffic. I clearly see the Execution Parameters are changing, but the response is not.

1 Like

Is this a part of an iterative event?

I used the developer tools in Edge, watched the Network Trace and clearly saw different Execution parameters, but no difference in response data.

For clarity, I’m calling Ice.BO.DynamicQuerySvc with ExecuteByID.

Screenshot?

I’m using a dataview-condition to identify that rows in the grid that need their columns udpated. The dataview-condion’s iterative event is calling me row event that actually makes the rest-erp call to get new data for a couple of the columns. Each request-response time is about 275 ms…

The Execution Parameters change per row that needs to be updated, but the response is exactly the same as the very first response. When I perform the same calls in the same order in Postman, the response data is different per row (and it’s correct).

I’m attaching my response.
Rest-erp and caching.docx (94.1 KB)

Any reason you’re not calling BaqSvc? Are you building the query on the fly?

BaqSvc accepts parameters in the query string, which would invalidate the cache.

2 Likes

That’s fantastic, but the other should work as well, so since we’re halfway down this road, let’s get it diagnosed in case it needs to be fixed.

1 Like

Agreed. We don’t know if it is the cache or not. You can try setting a cache header:

request.AddHeader("Cache-Control", "no-cache");
1 Like