I have developed an API layer that sits between CMS and frontend. The issue I am facing is to do with updated content in CMS not getting picked by my API.
After deploying API if I go to CMS and update a page or add some block on a page then this new change is not picked up by API.
I am experiencing same this while working in local, If I stop my Visual studio and start the debugging session again then it will pick new data, similarly, on Azure, I have restart my API web App for it to pick up new changes.
My understanding is the data is been cache, Is this a way I can stop cahceing in Episerver?
any code samples from your api?
Sorry about not following up on this post, I manage to resolve it by making Cache disable at Configs/ecf.catalog.config file
<Cache enabled="false" collectionTimeout="0:0:0" entryTimeout="0:0:0" nodeTimeout="0:0:0" schemaTimeout="0:0:0" />
You might get better answers on the commerce forum https://world.episerver.com/forum/developer-forum/Episerver-Commerce/ as it looks like you API is providing commerce catalog items? Maybe you shouldn't just disable the catalog cache but evaluate how up to date your API has to provide. Lower your API caching time so you pick up changes in catalog sooner or implement notification to your API when the catalog has changes usin https://world.episerver.com/documentation/developer-guides/commerce/catalogs/catalog-content/catalog-events/ (but please read the notes what kind of limitations the catalog events have).
There is a very elaborate system of cache dependencies that should make sure that the items returned by our APIs are always up to date. We currently have no known bugs in this area. So you should not need to disable any cache. Doing so will most likely have a severe negative impact on the performance of your application.
It is not clear to me from your description how your application is structured. I'm guessing your API is something serving remote requests, like a REST API? Does that code run in the same application as the one serving the epi UI where you update the content (you say page and block, do you actually mean catalog content - pages and blocks have nothing to do with the ecf Catalog cache setting)? If not, the two applications must be set up correctly with remove event replication (which requires different setup when running locally and on Azure). Same if you are using load balancing.
In general, more information about your code, architecture, versions etc is helpful in a question like this.