Developer forum

Forum » Integration » Performance and Zero results clearing cache

Performance and Zero results clearing cache

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

Summary: The EcomProvider (as Destination) seems to be clearing the cache even when there are no results to import. This was found in 9.17.2

 

Setup:

  • We have many scheduled tasks that run every 5 minutes to get data from the ERP
    • As expected, not every response will have results
  • We use the EcomProvider for the Jobs associated with the tasks
  • The setting "Disable cache clearing" is unchecked so that when data does come, it clears the cache

 

Issue: 

We seem to have had the cache constantly cleared, even when no data was being imported. Looking into the source code of the EcomProvider:

  • There does not seem to be a check whether records were mapped - so it will clear the cache every time the job runs, regardless if it's needed
  • It also seems to be using deprecated methods such as Ecommerce.Common.Application.KillAll() 
  • We noticed it only because our project has +100.000 Product Groups, so it's a noticeable delay when the data is not retrieved from cache.

 

Question/Request

Is this by design? Or could the EcomProvider check for the need to clear the cache based on having no results (instead of simply having finished the run). Maybe even check for that in the RunJob() method so a connection to the DB is not even open?

 

Best Regards,

Nuno Aguiar


Replies

 
Rasmus Sanggaard Dynamicweb Employee
Rasmus Sanggaard
Reply

Hi Nuno,

 

Sorry for the late response. This has been fixed in both 9 and 10. In 10 you have the option to choose if cache and index should be updated when no record are imported. In 9 that is default behavior now. 

 

BR Rasmus Sanggaard 

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Rasmus,

 

Not a problem. We kept an eye on it and have already applied it to some sites. Thank you anyway.

 

BR

Nuno

 

You must be logged in to post in the forum