I have a prototype of a custom data provider in Sitecore 9 that will be used to provide items created by an API.
Data is currently fetched in the constructor of the data provider.
Im unclear on a few things: - When the constructor of the data provider is called? Is it when the Database is initialised? - If the data returned by the api may change periodicaly e.g. every few hours, and I want to have control over when we hit the API, would it be best to move the logic to get data from the API to GetItemDefinition and then add the data to a custom cache ? - Is it best to implement scheduled publishing, or publish whenever data is fetched in order to keep web db up to date?