# Cache management in Spaces

**URL:** <https://discuss.huggingface.co/t/cache-management-in-spaces/19533>\
**Category:** Spaces\
**Created:** [June 23, 2022, 4:35pm UTC](https://discuss.huggingface.co/t/cache-management-in-spaces/19533 "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](https://discuss.huggingface.co/u/frgfm)\
**Post date:** [June 23, 2022, 4:35pm UTC](https://discuss.huggingface.co/t/cache-management-in-spaces/19533/1 "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](https://discuss.huggingface.co/u/chris-rannou)\
**Post date:** [June 24, 2022, 7:39am UTC](https://discuss.huggingface.co/t/cache-management-in-spaces/19533/2 "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](https://discuss.huggingface.co/u/frgfm)\
**Post date:** [June 25, 2022, 12:09pm UTC](https://discuss.huggingface.co/t/cache-management-in-spaces/19533/3 "2022-06-25T12:09:18Z")

</div>

Thanks for the fix Chris 🙏
