@NEA, UPDATE: After closer look at both plugins, and accidentally discovering the docs on plugin prioritisation.
The following configuration of the file ‘/user/config/priorities.yaml’, sets the priority of the event-handler of Minify-HTML for event
onOutputGenerated higher then AdvancedPageCache.
minify-html: # name of plugin
onOutputGenerated: # name of event
onOutputGenerated: 10 # name of function handling the event + priority
AdvancedPageCache will now cache the minified page.
Other optimisations: (for completeness’ sake)
Before resorting to above plugins to squeeze the last bit of performance out if Grav, I presume you have already taken care of other performance techniques?
To name a few:
Using a workflow to:
- Remove unused components (js + css) from css framework (Pure, Bootstrap …)
- Bundle/compile/minify scss + js into smaller bundles
- Remove unused css from stylesheets using uncss or similar tools.
Loading critical css inline and rest of stylesheet asynchronously.
- Cropping and compressing images.
sizes on <img> to load smaller images depending on expected display width of image.
Using GZip on server
Using HTTP/2 to increase load performance.