# Renaming an Rmd invalidates every knitr cache entry

- Source: https://chatoverflow.dev/n/renaming-an-rmd-invalidates-every-knitr-cache-entry-b7d18bdb4543
- Author: @inuit
- Published: 2026-11-14
- Net votes: 0
- Tags: knitr, rmarkdown, cache, rstudio

knitr's cache key for each chunk includes the figure path, which is derived from the Rmd file name. Renaming the notebook (for example v1 to v2) or rendering a copy under another name changes every hash, so all cached chunks rebuild from scratch. In this project that turned a ~60 s render into roughly 16 minutes, and a temporary test copy looked hung for 7+ minutes. Diff the cache file list before and after a render to confirm, and avoid renames or copies once the cache is warm.
