Want to subscribe to topics you're interested in?
Become a Member

Nginx PageSpeed PageSpeed breaking SVGs?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by RB1, Dec 30, 2016.

  1. RB1

    RB1 Active Member

    266
    70
    28
    Nov 11, 2016
    California
    Ratings:
    +117
    Local Time:
    4:29 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    Just kind of curious because for the last couple of days SVGs haven't been displaying on one of my test websites.

    In the Chrome console I get the error:
    "Failed to load resource: net::ERR_CONTENT_DECODING_FAILED".

    I haven't tweaked any PageSpeed settings so perhaps it started happening after Nginx 1.11.8 or an update for something else.

    Running "pscontrol off" fixes the problem and turning PageSpeed back on makes the error occur again.

    Any other users experience something similar?
     
  2. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:29 PM
    Nginx 1.13.x
    MariaDB 5.5
  3. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:29 PM
    Nginx 1.13.x
    MariaDB 5.5
  4. RB1

    RB1 Active Member

    266
    70
    28
    Nov 11, 2016
    California
    Ratings:
    +117
    Local Time:
    4:29 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    Yes, I also found that Issue # after you suggested to look. Perhaps it's compression, but I do not want to completely disable that. I will try to only disable SVG when I get on my PC in the morning :)

    Thanks for the reply and sorry to bother :sorry:
     
  5. RB1

    RB1 Active Member

    266
    70
    28
    Nov 11, 2016
    California
    Ratings:
    +117
    Local Time:
    4:29 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    Hmm...adding:
    Code (Text):
    pagespeed Disallow "*.svg*";

    did not fix anything. I think it's possibly an issue with gzip; I'll see if someone replies on GitHub

    Edit:
    I believe running this fixed the issue:
    Code (Text):
    touch /var/ngx_pagespeed_cache/cache.flush

    I was only running these commands before:
    Code (Text):
    rm -rf /var/ngx_pagespeed_cache/*
    ngxrestart


    Edit 2:
    After a few page refreshes (or from clearing browser cache) I'm getting the same error again :(
     
    Last edited: Dec 31, 2016
  6. RB1

    RB1 Active Member

    266
    70
    28
    Nov 11, 2016
    California
    Ratings:
    +117
    Local Time:
    4:29 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    Update:
    It's possibly a problem with how my centminmod server is caching files?
    Adding a query string to my SVGs (*.svg?ver=1) fixes to problem but how do I find out what is causing this?

    If any member can give me some pointers I'd be very appreciative. Not really sure where to start as I've cleared a lot of my caches/re-installed some caching plugins/etc.
     
  7. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:29 PM
    Nginx 1.13.x
    MariaDB 5.5
    what's output for
    Code (Text):
    nginx -V

    wrap in QUOTE tags
     
  8. RB1

    RB1 Active Member

    266
    70
    28
    Nov 11, 2016
    California
    Ratings:
    +117
    Local Time:
    4:29 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    Code (Text):
    nginx -V

     
    Last edited: Jan 3, 2017
  9. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:29 PM
    Nginx 1.13.x
    MariaDB 5.5
    was checking to see if you had ngx_brotli module and compression enabled but you don't so not related to brotli compression

    do you have any cdn or reverse proxy in front of nginx ? i.e. cloudflare or sucuri cloudproxy caching static assets like svg and images ?
     
  10. RB1

    RB1 Active Member

    266
    70
    28
    Nov 11, 2016
    California
    Ratings:
    +117
    Local Time:
    4:29 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    No there is no CDN or reverse proxy on this domain :(
     
  11. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:29 PM
    Nginx 1.13.x
    MariaDB 5.5
  12. RB1

    RB1 Active Member

    266
    70
    28
    Nov 11, 2016
    California
    Ratings:
    +117
    Local Time:
    4:29 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    I don't have SSL setup on this domain and I've only been loading it with http://
    If I add https:// to the URL I get a mismatch error, but it says if trust issues are ignored I would receive an A rating
     
  13. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:29 PM
    Nginx 1.13.x
    MariaDB 5.5
  14. RB1

    RB1 Active Member

    266
    70
    28
    Nov 11, 2016
    California
    Ratings:
    +117
    Local Time:
    4:29 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    Last edited: Jan 6, 2017
    • Informative Informative x 1
  15. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:29 PM
    Nginx 1.13.x
    MariaDB 5.5
    yeah looks like you need a path :)
     
    • Like Like x 1
  16. RB1

    RB1 Active Member

    266
    70
    28
    Nov 11, 2016
    California
    Ratings:
    +117
    Local Time:
    4:29 AM
    Nginx 1.13.x
    MariaDB 10.1.x
    Weird how SVGs just kind of broke all of a sudden...I didn't make any changes to the configs before it started happening. Perhaps an update did it? :blackalien:
     
  17. eva2000

    eva2000 Administrator Staff Member

    28,935
    6,567
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,747
    Local Time:
    9:29 PM
    Nginx 1.13.x
    MariaDB 5.5
    yeah no idea as never ran into that issue

    best to use ngx_pagespeed issue tracker to discuss with ngx_pagespeed folks as it probably could be a bug
     
    • Like Like x 1