1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-12-21 03:45:57 +01:00
mkdocs-material/docs/plugins/requirements/caching.md
2023-09-14 19:09:18 +02:00

36 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
icon: material/database-outline
---
# Caching
Some of the [built-in plugins] implement intelligent caching mechanisms, which
massively speed up consecutive builds by reducing the amount of work that needs
to be done. This guide explains how to configure caching in different
environments.
## Prerequisites
Caching is entirely optional but enabled by default. It can be disabled per
plugin. If not configured otherwise, plugins will cache their data in the
`.cache` folder in the root of your project. For this reason it's recommended
to create a `.gitignore` file in the root of your project:
``` title=".gitignore"
.cache
```
This ensures that cached files are not added to your git repository something
that is generally not recommended to do unless absolutely necessary. In some
cases, you might need to check in cached files, e.g. when you need to
pre-generate [social cards] locally, e.g., when you're not be able to install
the image processing dependencies in your continuous integration (CI)
environment.
In this case, we recommend changing the `cache_dir` setting something that all
plugins that implement caching share to a folder which you add to your git
repository.
[built-in plugins]: ../index.md
[social cards]: ../../setup/setting-up-social-cards.md