nextcloud / cms_pico

🗃 Integrate Pico CMS and let your users manage their own websites
https://apps.nextcloud.com/apps/cms_pico
GNU Affero General Public License v3.0
134 stars 42 forks source link

Extremely poor performance. #228

Closed Bockeman closed 1 year ago

Bockeman commented 1 year ago

I have several cms_pico pages with many small images. Each of these pages takes a very long time, like several minutes, to render (i.e. for anything to appear on the screen) Is cms_pico simply not capable of handling such complex pages efficiently, or is there some limitation on my server? If the latter, please could you suggest a strategy to identify any possible bottlenecks.

PhrozenByte commented 1 year ago

Handling pages with many images is problematic due to how Nextcloud publishes images: In contrary to "regular" websites, we can't simply serve images directly via webserver, but must route everything through PHP. Every single image request yields a full dynamic PHP interpretation. That's simply because the website's assets are stored inside your Nextcloud. You'll experience the same when using Nextcloud's gallery app, or Nextcloud's activity app when uploading many images. The only way to solve this is to remove the bottleneck: Nextcloud (i.e. use "pure" Pico).

Bockeman commented 1 year ago

@PhrozenByte that is very interesting to learn why cms_pico might be slow in some cases. I really like how, with zero prior experience and relatively little code, I was able to get pages to appropriately render on desktops or different sizes and orientations of smart phone screens.

The whole point of me serving web pages behind Nextcloud is that I get all the security that Nextcloud affords without me having to worry about it. My website, like any other, is under constant attack and I cannot afford the risk of exposing sensitive information.

I am using cms_pico for presenting genealogical data graphically with portrait photos of individuals etc, where users can click on various places within the tree to expand, collapse or visit other entries. I am sure you realise the sensitive nature of this data and why it needs to be fine tuned to the logged in individual visiting the site.

If you could suggest an alternative to cms_pico within NC that meets my requirements (without me having to personally code up the security aspects), then I'd willingly take a look at that. However, assuming not, I wonder if there might be some compromise.

  1. Is there some way to pre-render and/or cache the parts that make cms_pico slow?
  2. Is there a way to render a "splash screen" which can be customised to explain to the user (site visitor) what is going on and how long to expect to be waiting for the full page to render.
  3. Ideally, is there a way for pico_cms to progressively render all the page, starting with boxes/lines, then text and finally filling in the images one at a time. This way, the user could even click on a location and navigate elsewhere before waiting for the whole page to render. If this could not be built-in to cms-pico (helping all users), is there a way to code the ML to acheive this effect?
PhrozenByte commented 1 year ago

Progressively rendering the page (precisely loading images not before actually expanding the entry) is likely the best solution in your case, however, that's nothing Pico can do for you, but a task for your custom theme. You have to add a so called "lazy loading" strategy for images within your website. Everything else (boxes/lines/text/…) likely isn't the bottleneck here.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two days if no further activity occurs. Thank you for your contributions! :+1: