CMSAzureCachePath and Server file caching - Migrating media files to blob storage

Chris Percival asked on February 14, 2024 17:44

We're attempting to migrate large numbers of images from disk to blob storage as we're running out of disk space to store images. As I understand it Kentico will cache the files pulled from blob storage on the disk anyway. If this is the case, then we won't save space by moving them all to blob storage as they'll end up being on the disk anyway.

My question is, does the "Server file caching" settings in Settings->System->Performace still control these cache files from Azure blob storage. Eg if they're only cached for a certain period before being automatically removed, this will stop the disk from filling up.

Recent Answers


Brenden Kehren answered on February 14, 2024 17:58

No the setting does not. Seems like you've already created your custom code for the Azure Storage Provider. Read some additional documentation to help offload those temp files too. This should help with those additional /App_Data/AzureCache and /App_Data/AzureTemp directories.

https://docs.kentico.com/13/custom-development/working-with-physical-files-using-the-api/configuring-file-system-providers/configuring-azure-storage

https://docs.kentico.com/13/deploying-websites/running-xperience-on-microsoft-azure/deploying-to-azure-web-apps/scaling-azure-web-apps#setting-up-shared-storage-for-physical-files

0 votesVote for this answer Mark as a Correct answer

Chris Percival answered on February 14, 2024 18:01

So you're confirming that it pulls blob files down to disk anyway when they're used, and stored there indefinitely? This will just end up filling up our space on disk again that we're trying to avoid.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on February 14, 2024 18:16

The system stores files there so it can show thumbnails faster. There are scheduled tasks to clear that data up so those files will not remain on the server indefinitely.

Without seeing your set up, code, etc., it's hard to say 100% what is going on but I can tell you the following:

  • The custom code for the custom Azure Provider needs to be in both the MVC project and the CMS project.
  • When you migrate all the files to Azure Blob storage, clear out both the MVC and CMS project file systems on the server. This will help you identify if there are additional files being stored on the server and where.
  • Be sure to map all possible locations:
    • /<sitecodename>/media - default location of media library
    • /<sitecodename>/files - default location of page attachements
    • /<sitecodename>/bizformfiles - default location of form attachments

You could also map the /App_Data/AzureCache and /App_Data/AzureTemp directories too.

0 votesVote for this answer Mark as a Correct answer

Chris Percival answered on February 14, 2024 18:58

Ah yes, the AzureStorageCacheCleaner task, found the docs: https://docs.kentico.com/13/deploying-websites/running-xperience-on-microsoft-azure/preventing-azure-cache-folders-from-bloating#configuring-the-clean-azure-storage-cache-scheduled-task

So I think this is the main issue resolved; the disk won't fill up again with cache images if the AzureStorageCacheCleaner runs.

Thank you!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.