<p>There are no real good solutions here, unfortunately.</p>
<p>There isn't a native way to move <code>/cpresources</code> to cloud-based storage. This is mainly because of the limitations of Yii's asset bundles, which make this unfeasible. We do plan on solving this for Craft 6, though.</p>
<blockquote>
<p>or maybe is it possible to prebuild cpresources and have them static in the deployment?</p>
</blockquote>
<p>This is essentially what we currently do on Craft Cloud, but it’s not something we’d recommend or want to support broadly on self-hosted Craft installs. It’s a pretty hacky/brittle solution.</p>

CC BY-SA 4.0
2024-05-17T21:49:12.683Z
Thanks Brad! Since you mention Yii's asset bundles I assume not the whole directory content of /cpresources is created at once but only after opening CP pages that use the resource, correct?
Matthias Redl-Mann
CC BY-SA 4.0
2024-05-20T06:39:47.107Z
Correct - they're published on demand.
Brad Bell
CC BY-SA 4.0
2024-05-17T18:25:01.187Z
2024-05-17T18:25:01.187Z
Brad Bell
<p>is it possible to have /cpresources in a cloud storage like Azure BLOB storage and that Craft writes them to the cloud when needed?
Thanks!</p>

CC BY-SA 4.0
2024-05-17T10:36:16.593Z
or maybe is it possible to prebuild cpresources and have them static in the deployment?
Matthias Redl-Mann
<untagged>
/cpresources in a cloud storage
# /cpresources in a cloud storage

(Asked by: username_0 on 2024-05-03)

is it possible to have /cpresources in a cloud storage like Azure BLOB storage and that Craft writes them to the cloud when needed?
Thanks!

**Tags:** untagged
> **Comments:**
> **username_0**: or maybe is it possible to prebuild cpresources and have them static in the deployment?  

---

## 1 answers

### Answer by username_1 on 2024-05-17. Score: 0

There are no real good solutions here, unfortunately.

There isn't a native way to move `/cpresources` to cloud-based storage. This is mainly because of the limitations of Yii's asset bundles, which make this unfeasible. We do plan on solving this for Craft 6, though.

> or maybe is it possible to prebuild cpresources and have them static in the deployment?

This is essentially what we currently do on Craft Cloud, but it’s not something we’d recommend or want to support broadly on self-hosted Craft installs. It’s a pretty hacky/brittle solution.

> **Comments:**
> **username_0**: Thanks Brad! Since you mention Yii's asset bundles I assume not the whole directory content of /cpresources is created at once but only after opening CP pages that use the resource, correct?  
> **username_1**: Correct - they're published on demand.  

---

