Serve SVGZ images with hugo server (IGNORE, browser support is not there yet 1/2023)

Well just tried add custom server response header for svgz file extension, and it does work :confounded: .

I tested both on Google Chrome and Firefox, both display the svgz via img and object.

The extra config:

# config.toml
[server]
[[server.headers]]
  for = '*.svgz'
  [server.headers.values]
    Content-Encoding = 'gzip'
    Vary = 'Accept-Encoding'

[mediaTypes."image/svg+xml"]
  suffixes = ["svg","svgz"]

But here i made test repo:

Hugo Server Response config docs:

1 Like