What is the fastest way to get a pages collection?

Assuming I have several sub-pages within a dedicated folder (/blog), what would be the server-wise fastest way to get a collection of these sub-pages?







THX, Yves

I don’t know, but there is another option:


Wow, now we have four ways of doing the same job :wink: But still the one question which of the four versions does the job the fastest? Or could their speed be neglected since the looping through all sub-pages would take the biggest chunk time-wise? And another thought: Once the collection is fetched, does the speed of a foreach-loop differ for the different ways of building the collection?

They are all equally fast since they are doing their calculations based on an in-memory list of pages (this also applies to operations on the newly built collection). It doesn’t matter at all and only depends on what fetching method you prefer/need.
I recommend page('blog') though, it’s the shortest and easiest to understand.