WebOptimizer icon indicating copy to clipboard operation
WebOptimizer copied to clipboard

Disk caching is not working when deploying the application using zip deploy

Open koljada opened this issue 2 years ago • 1 comments

When I deploy my asp net 6 application using web deploy everything works fine. But when I deploy it using zip deploy disk caching is not working: I receive 500 errors for my static files. I had to set enableDiskCache to false to keep my production site running. I use AzureRmWebAppDeployment@4 azure devops task for deployment which by default use zip deploy and set following env variables: WEBSITE_RUN_FROM_PACKAGE=1 and WEBSITE_ENABLE_SYNC_UPDATE_SITE=true.

Is it not possible to use disk caching with zip deployment? If so, then I think it should be mentioned in docs

koljada avatar Jun 23 '23 16:06 koljada

While you can't write to the wwwroot folder, there are other folders that you can use on the App Service. See details for Windows (I'm not sure if there's a page for Linux deployments, but you can create files and folders in /tmp)

You can set the folder that the disk cache uses: WebOptimizerOptions.CacheDirectory in code or have a look at the main page for json.

MatthewSteeples avatar Jan 12 '24 17:01 MatthewSteeples