• When I upload files, such as SVG files, they’re stored compressed, but the file metadata in Google Cloud Storage shows Content-Encoding empty, which makes them unavailable.

    When accessing the SVG file from my browser I get:

    This page contains the following errors:
    error on line 1 at column 1: Encoding error
    Below is a rendering of the page up to the first error.

    However, if I edit the metadata manually from Google Cloud Storage interface, setting Content-Encoding to gzip, then I get the file correctly.

    Have tried a few things, but can’t find a way to store them with the correct metadata, or to edit it from WordPress afterwards.

    • This topic was modified 4 years, 8 months ago by jesusinica.
Viewing 1 replies (of 1 total)
  • Plugin Contributor ianmjones

    (@ianmjones)

    That’s weird, WP Offload Media explicitly sets that Content-Encoding metadata.

    Maybe best to just not allow WP Offload Media to gzip the file…

    function my_disable_as3cf_gzip_mime_types( $mime_types, $media_library ) {
        return array();
    }
    
    add_filter( 'as3cf_gzip_mime_types', 'my_disable_as3cf_gzip_mime_types', 10, 2 );

    We’re thinking about taking out this functionality as most bucket / CDN providers do their own gzip stuff these days.

Viewing 1 replies (of 1 total)
  • The topic ‘Content-Encoding: gzip missing from Google Cloud Storage Objects’ is closed to new replies.