Skip to content

Optimize performance of the pages loading by stopping using filesystem always #2380

@Koc

Description

@Koc

Is your feature request related to a problem? Please describe.
I profiled some endpoints, e.g. PublicPageController::index() and realized that we have a lot of more or less repeatable queries to database, mostly filecache table. For some of our collectives we have up to 500 queries per collective view. This happens because PageService::getPagesFromFolder() recursively loads all files from a folder and then loads pages for each file one by one. The more pages we have with deeper nesting level -> the bigger quantity of queries we got.

Describe the solution you'd like
As we already have collectives_pages table - let's use it to load all pages for collective in a single query. We need just add columns like collective_id, parent_id, etc.

Of course we need also somehow maintain this table for cases when users creating files via filesystem instead of using Collectives app. But this can be a background process.

WDYT guys?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions