# Cache management in Spaces

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcache-management-in-spaces%2F19533%3E%5C
**Category:** Spaces\
**Created:** [June 23, 2022, 4:35pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcache-management-in-spaces%2F19533 "2022-06-23T16:35:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frgfm](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/frgfm/32/5171_2.png) [@frgfm](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ffrgfm)%5C
**Post date:** [June 23, 2022, 4:35pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcache-management-in-spaces%2F19533%2F1 "2022-06-23T16:35:00Z")

</div>

Hello there 👋

First, thanks a lot for this incredible platform that allows thousands of developers to showcase their work! We’ve been using HF Spaces to run a small streamlit demo for OCR for a while now, which works great 🙂  
DL models are downloaded to a `.cache` folder, then loaded into the memory to perform the inference.

But a few days ago, it seems we cannot create subfolder in the `.cache` directory as I get `PermissionError`. To reproduce the behaviour, you can go to [docTR - a Hugging Face Space by mindee](https://huggingface.co/spaces/mindee/doctr), upload any picture or PDF, then click on analyze.

The traceback points to `pathlib.Path.mkdir` method which now throws a `PermissionError`. Was there any recent change to folder permissions recently on Spaces? If so, how can I fix this? 🙏

Best

---

<div class="post-metadata">

**Author:** ![chris-rannou](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@chris-rannou](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fchris-rannou)%5C
**Post date:** [June 24, 2022, 7:39am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcache-management-in-spaces%2F19533%2F2 "2022-06-24T07:39:19Z")

</div>

Seems to be okay now

---

<div class="post-metadata">

**Author:** ![frgfm](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/frgfm/32/5171_2.png) [@frgfm](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ffrgfm)%5C
**Post date:** [June 25, 2022, 12:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcache-management-in-spaces%2F19533%2F3 "2022-06-25T12:09:18Z")

</div>

Thanks for the fix Chris 🙏
