Advanced page cache + minify

It seems that the Minify Plugin does not work, if the Advanced page cache plugin is activated. Is there any possibility, to make both plugins work at the same time? Meaning First minify the page html and the give it over to the Advanced page cache.

I have seen the plugin prioritization (priorities.yaml) however I would not know how to configure it.

@NEA, UPDATE: After closer look at both plugins, and accidentally discovering the docs on plugin prioritisation.

Prioritising plugins:
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.

  • Using defer to load javascript asynchronously.

  • Optimizing images:

    • Cropping and compressing images.
    • Using srcset and sizes on <img> to load smaller images depending on expected display width of image.
  • Adding expiration headers on images, javascript and css to prevent browser to load resources unnecessarily.

  • Using GZip on server

  • Using HTTP/2 to increase load performance.