Docs: improve caching for make docs Upstream-commit: c8399630ca5c85ab3020a3d621e11f536d9ac6ee Component: engine