Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-17T21:49:12.683Z
Answers.Text: 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?
Answers.UserDisplayName: Matthias Redl-Mann
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-20T06:39:47.107Z
Answers.Text: Correct - they're published on demand.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-05-17T18:25:01.187Z
Answers.LastActivityDate: 2024-05-17T18:25:01.187Z
Answers.UserDisplayName: Brad Bell
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-05-17T10:36:16.593Z
Comments.Text: or maybe is it possible to prebuild cpresources and have them static in the deployment?
Comments.UserDisplayName: Matthias Redl-Mann
Tags: <untagged>
Title: /cpresources in a cloud storage
ThreadText: # /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 username_1! 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.  
  
  ---
  
  