the yaml files (and to some degree even their php conterparts) need to loaded and parsed for extending presets, layouts and extends.
with more and more people using lots of blocks 30+ in a single setup this creates a heavy load to initialize.
what if the parsed endresult of a pages blueprint is stored as an optimized php file fully unrolled? with proper code these php should be recognized by standard php cache libs like apcu, cached and thus be loaded faster.
the cache should be optional like the pages cache and clear itself if any blueprint file was modified.
i thinks its at least worth a try.
This is something that should really get more attention. As soon as there is large amount of options navigating through panel and saving gets very slow.
Let’s say we cached the blueprints like pages. So how do we know if there is a change in the blueprints? The panel does this for pages. However, blueprints are currently edited manually. For this, we will need to read all the blueprints again. Do you have an idea?
in my php based blueprints plugins i have an option (attribute based in that case but a yaml option like preset
would work as well, see example below). that setting controls if and for how long the blueprint is cached. blueprints do not change often and the cache is only intendend to speed things up for repeated calls, like the panel accessing the same page via api a few times within a minute.
site/blueprints/pages/demo.yml
preset: page
cache: 60 # in seconds, or if ommited defaulting to false/null
i my case i treat 0 time special, like the kirby cache does and store for infinite duration, and that would require a manual flush. but thats fine imho as long as its documented.
Thank you @bnomei I’ve tried to implement in https://github.com/getkirby/kirby/pull/6759 I need to test with many blueprints setup. Could you provide us some complex blueprints setup to test it? @bnomei @Branko Matić