mkdocs-material: Projects plugin cache not being updated
Context
Using the projects plugin in Insiders, I am having the problem that it seems the cache is never updated.
Bug description
Changes to the mkdocs.yml
files in project do not get picked up. I am changing the color scheme as an example, see below. It seems the config.pickle
file in .cache
is not getting updated when a mkdocs.yml
file in a project is changed.
Related links
Reproduction
9.4.8+insiders.4.43.0-projects-plugin-cache.zip
Steps to reproduce
rm -rf .cache
mkdocs serve
- Open subproject in a browser and observe that the project has an indigo palette
- In another window, edit the project’s
mkdocs.yml
to set the palette tored
- Make a change to the
docs/index.md
to see that the browser updates - You will see that while the change from (5) shows, the palette is still indigo
- Restart
mkdocs serve
- Observe that the color scheme still has not changed.
- Stop
mkdocs serve
rm -rf .cache
- Start
mkdocs serve
- Observe that the color scheme has changed now.
Btw. I selected a browser below without thinking and it seems this selection cannot be reset?
Browser
Other
Before submitting
- I have read and followed the bug reporting guidelines.
- I have attached links to the documentation, and possibly related issues and discussions.
- I assure that I have removed all customizations before submitting this bug report.
- I have attached a .zip file with a minimal reproduction.
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Comments: 15 (11 by maintainers)
Fixed in
f1cb613
. I did a rewrite of the plugin and changed the approach to caching, so the workaround suggested in https://github.com/squidfunk/mkdocs-material/issues/6306#issuecomment-1798206523 is no longer needed. Also see https://github.com/squidfunk/mkdocs-material/issues/6399#issuecomment-1849020584 to learn what the rewrite solved as well.I wanted to wait with the next release until I finished the refactoring, but it’s gotten so big, I needed to get it out before it wouldn’t fit through the door anymore. I’ll continue working on this and I’m close to having a working version fixing the caching issues and improving the overall structure of the plugin.
Did a quick test by modifying the
mkdocs.yml
files in one of our examples and it did get picked up. Thanks for fixing this. I will try and do some more work with the projects plugin in the coming days and will report any remaining issues I find but this fix and the other one that helped with newly created projects or those that do not use Material fix the two issues I had some across - IIRC.The cache must be created - we need a way to store intermediate results. This is the same for all plugins. What we could do in theory (but I haven’t done it, because nobody complained) is to create a temporary directory and use that for intermediate storage, but the plugins definitely need intermediate storage. Thus,
cache
disables cache usage, not the cache itself.I’ll investigate as soon as possible.