Developer forum

Forum » Feature requests » Content API without side effects

Content API without side effects

Morten Bengtson
Reply

Hi,

Sometimes we create content programmatically, but using the API for this can be a PITA, because everytime we call a Save method some internal cache is cleared or it has some other weird side effect. This brings the site to its knees when we have to create a lot of content like pages, paragraphs, users etc.

Right now I'm having problems with saving paragraphs. It seems like there is no way to save a paragraph without clearing the internal cache at the same time. I would like to be able to save multiple paragraphs and then clear the cache when I'm done. I couldn't find any way to do that using the standard API. 

Using Data Integration is not always a suitable solution - e.g. we want to be able to create some content when certain events are triggered. Also, I don't think it should be necessary for us to create our own API or call the database directly (ugh!) and if we do that we risk messing up some data formats or relations between content.

And it's not just clearing the cache that is causing problems. Sometimes the content API is accessing HttpContext for various reasons. It might have made sense when it was made, but sometimes you just want an API that just does what it says. When I see a method called Save then I expect that method to just save the data and not do a lot of other stuff too ;-)

End of rant


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

+1

 
Asger Munkholm Højfeldt
Reply

Hi Morten,

Thanks for your input - it's not simple an operation to do so I can't implement it right away. I will add your whish to the list and consider it for a future release. 

//Asger