fralau / mkdocs-mermaid2-plugin

A Mermaid graphs plugin for mkdocs
https://mkdocs-mermaid2.readthedocs.io
MIT License
203 stars 25 forks source link

Cache check whether library URL exists slow down build #44

Closed jannschu closed 2 years ago

jannschu commented 2 years ago

Hi,

first, thanks for this plugin!

I noticed that my total build times increased significantly after adding this plugin (went from 5s to 20s). Upon further inspection I noticed that the code checks whether the JavaScript library exists at the configured URL by sending a HTTP request on every page although the library URL does not change.

Caching the URL check did show a very nice performance boost and brought build time down to 6s, so I propose to implement caching for this.