alanta / Kontent.Statiq

Module to retrieve content from Kentico Kontent for building static websites with Statiq
MIT License
10 stars 3 forks source link

Support for other delivery endpoints #20

Open petrsvihlik opened 3 years ago

petrsvihlik commented 3 years ago

Is there a reason why there is support only for the /items endpoint? Was it a deliberate choice or was it just because of the lack of time and it's still the plan to support them at some point?

I can see that for larger projects it could be handy to implement the /items-feed as well. The same goes for the taxonomies... (not to mention other endpoints)

alanta commented 3 years ago

There simply was no need for it yet. It definitely makes sense to support other end-points. Maybe it's best to first think about what that would look like in code for people using Kontent.Statiq?

petrsvihlik commented 3 years ago

I suggest we keep this one open and collect feedback here. I'll definitely have some input myself soon and it was already mentioned by one of our team members too :)

Simply007 commented 3 years ago

Single /item endpoint makes sense for me.

Currently, I am using this a a workaround:

new Kontent<Root>(client)
     .WithQuery(
         new EqualsFilter("system.codename", "root"),
         new LimitParameter(1),
         new DepthParameter(3)
     );
Simply007 commented 3 years ago

This might be a single-use purpose, but /items-feed would help me for bigger datasets for my Kontent - Statiq benchmark.

Or maybe use Paging API for that purpose.

More context here: https://github.com/Kentico/statiq-kontent-collaboration/issues/18

I have datasets for:

alanta commented 3 years ago

@Simply007 I added very naive support for items feed, this is the result: image

I'll see about optimizing this a bit.

alanta commented 3 years ago

Well, looks like the second run was already a lot faster. I'm assuming that's due to caches being primed from the first run (?). Running the test in a release build shaved off another couple of seconds. I tried profiling but did not see any significant slow downs in the Kontent.Statiq module. Here's the result. I'll push my changes as well.

image

petrsvihlik commented 3 years ago

fyi - we have a new endpoint :)

https://github.com/Kentico/kontent-delivery-sdk-net/blob/77d7c9e3cc8d08a82a321b735ca1ad5df25ae31d/Kentico.Kontent.Delivery.Abstractions/IDeliveryClient.cs#L78