Static content compression is not working
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
We serve Vue.js 3 static web app on the Azure Static Web Apps, built using Vite. It works fine, but all returned Content-Encoding is empty on .css, .js, and. HTML files. So, all files come uncompressed.
We created the Static Site via the Terraform approach:
```
resource "azurerm_static_site" "spa1" {
name = "${var.app_service_name}Spa1${title(var.environment)}"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
sku_tier = "Standard"
sku_size = "Standard"
}
```
And the app is deployed via Azure DevOps pipelines:
```
- deployment: Deploy
displayName: Deploy
environment: Development
pool:
vmImage: ubuntu-20.04
strategy:
runOnce:
deploy:
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Artifacts'
inputs:
buildType: 'current'
targetPath: '$(Pipeline.Workspace)'
- task: ExtractFiles@1
displayName: 'Extract files'
inputs:
archiveFilePatterns: '/home/vsts/work/1/spa/development/node.zip'
destinationFolder: '$(Build.ArtifactStagingDirectory)/out'
cleanDestinationFolder: false
- task: AzureStaticWebApp@0
inputs:
app_location: '/out'
api_location: ''
output_location: ''
skip_app_build: true
is_static_export: true
azure_static_web_apps_api_token: $(azureStaticWebAppsApiToken)
workingDirectory: $(Build.ArtifactStagingDirectory)
```
Our staticwebapp.config.json file looks like this:
```
{
"globalHeaders": {
"content-security-policy": "default-src https: 'unsafe-eval' 'unsafe-inline'; object-src 'none'"
},
"navigationFallback": {
"rewrite": "/index.html",
"exclude": ["/img/*.{png,jpg,gif,webp}", "/css/*"]
},
"mimeTypes": {
"custom": "text/html"
}
}
```
When we turned off Enterprise-grade edge, it started to use Content-encoding: br.
Is this a bug, or have we missed something?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.