OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

INavigationFilter implementations should not repeat queries #8689

Closed MatteoPiovanelli-Laser closed 1 year ago

MatteoPiovanelli-Laser commented 1 year ago

We noticed some "repeated" queries when generating some test pages.

As the system has to build menus, if the same menu is configured in more places in the page (e.g. in more than one widget in different zones) some providers will repeat the queries they use to fetch the relevant information. The "culprits" we found so far are:

Both this situations can be fixed easily by memorizing the results of the first pass.

A PR for this is coming.

BenedekFarkas commented 1 year ago

Can this be solved together with #8688 or the underlying logic is too different?

MatteoPiovanelli-Laser commented 1 year ago

They are different/unrelated. This one is at a "higher level", in a sense. These providers should be repeating operations they don't need. The other issue is deeper, and I think it should be handled transparently from whatever modules are doing.

sebastienros commented 1 year ago

In OC these menus are cached on the page itself, using fragment caching.