Get the most out of your Centmin Mod LEMP stack
Become a Member

Nginx PageSpeed Some Images Not Being Optimized

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by xhash, Dec 24, 2015.

  1. xhash

    xhash New Member

    6
    1
    3
    Dec 24, 2015
    Ratings:
    +1
    Local Time:
    8:18 AM
    1.9.9
    10.0.23-MariaDB MariaDB Server
    Hi there,

    I've recently installed the following:

    CentOS 6.5 + Centmindmod with NginX, PageSpeed, MariaDB, CSF etc (performed the auto install).

    I've run into an issue with compression - for some odd reason, 3 images simply wont be compressed, I am out of luck as to why.

    [​IMG]

    I checked Google to see if other users were also experiencing the same issue - apparently 'noauth' and 'nocache' should not be set on these images (they aren't from what I can tell), also these images are being appended with .pagespeed as seen from the above report from Insights.

    The website address is: Positive Lending Solutions | #1 Car Loans Aus Wide
    Google Insights: PageSpeed Insights

    pagespeed.conf file:

    [​IMG]
     
  2. eva2000

    eva2000 Administrator Staff Member

    31,011
    6,922
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,428
    Local Time:
    7:18 AM
    Nginx 1.13.x
    MariaDB 5.5
  3. xhash

    xhash New Member

    6
    1
    3
    Dec 24, 2015
    Ratings:
    +1
    Local Time:
    8:18 AM
    1.9.9
    10.0.23-MariaDB MariaDB Server
    Hi eva2000,

    Thanks for the quick response, I've searched the forums and already gone through both of those links - unfortunately I can't seem to get just 3 (out of probably 60+ images to optimize).

    Any other suggestions?
     
  4. eva2000

    eva2000 Administrator Staff Member

    31,011
    6,922
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,428
    Local Time:
    7:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    troubleshooting links should direct you to looking into ngx_pagespeed message logs page for clues :) The message log page has a search filter you can run for image names
     
  5. xhash

    xhash New Member

    6
    1
    3
    Dec 24, 2015
    Ratings:
    +1
    Local Time:
    8:18 AM
    1.9.9
    10.0.23-MariaDB MariaDB Server
    Hi eva2000,

    If you're referring to the message history which is available here: http://ps.amebae.com/pagespeed_global_admin/message_history

    It's already been checked - I couldn't attach it to my first response (it wouldn't allow me to create the thread I believe due to the size of my post), I've listed it here on Gist: gist:09f9a840cde6415a413a · GitHub

    If I use an example of one of the images that Insights is reporting is 'not optimized', the logs state that it has been shrunk:

    [Wed, 23 Dec 2015 15:11:36 GMT] [Info] [23559] http://ps.amebae.com/:623: Shrinking image `http://ps.amebae.com/uploads/blogs/11/fit_204x157_baloon_payment_header_image.png' (34108 bytes) to `http://ps.amebae.com/uploads/blogs/..._header_image.png.pagespeed.ic.Vr2GMnIzLK.png' (25572 bytes)

    The above file-name corresponds with what is listed at Google Insights.

    PS. I can normally troubleshoot issues myself, however I have spent almost 6 hours trying to figure out why it isn't working to no avail.
     
  6. eva2000

    eva2000 Administrator Staff Member

    31,011
    6,922
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,428
    Local Time:
    7:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    curl tests show that image was resized so google pagespeed insights is wrong !

    34108 bytes original

    Code:
    curl -I http://ps.amebae.com/uploads/blogs/11/fit_204x157_baloon_payment_header_image.png
    HTTP/1.1 200 OK
    Date: Wed, 23 Dec 2015 16:01:41 GMT
    Content-Type: image/png
    Content-Length: 34108
    Last-Modified: Mon, 21 Dec 2015 01:28:46 GMT
    Connection: keep-alive
    ETag: "567755ce-853c"
    Server: nginx centminmod
    Expires: Thu, 22 Dec 2016 16:01:41 GMT
    Cache-Control: max-age=31536000
    Accept-Ranges: bytes
    25572 bytes pagespeed optimised
    Code:
    curl -I http://ps.amebae.com/uploads/blogs/11/xfit_204x157_baloon_payment_header_image.png.pagespeed.ic.Vr2GMnIzLK.png
    HTTP/1.1 200 OK
    Content-Type: image/png
    Content-Length: 25572
    Connection: keep-alive
    Server: nginx centminmod
    Accept-Ranges: bytes
    Date: Wed, 23 Dec 2015 15:12:35 GMT
    Expires: Thu, 22 Dec 2016 15:12:35 GMT
    Cache-Control: max-age=31536000
    ETag: W/"0"
    Last-Modified: Wed, 23 Dec 2015 15:12:35 GMT
    X-Page-Speed: 1.9.32.11-7553
    
     
  7. xhash

    xhash New Member

    6
    1
    3
    Dec 24, 2015
    Ratings:
    +1
    Local Time:
    8:18 AM
    1.9.9
    10.0.23-MariaDB MariaDB Server
    I also ran the same cURL test, verified it via Firebug to see 'X-Page-Speed: 1.9.32.11-7553'

    :/ I thought as much, is it normal for Google Insights to push out false-positives? because I've noticed that sometimes the statistics are inconsistent at times, there's no explanation at all or anything that I can locate to see why this happens...
     
  8. eva2000

    eva2000 Administrator Staff Member

    31,011
    6,922
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,428
    Local Time:
    7:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    from gtmetrix looks like the images can be compressed and optimised further than ngx_pagespeed did Latest Performance Report for: http://ps.amebae.com/?PageSpeed=on | GTmetrix

     
  9. eva2000

    eva2000 Administrator Staff Member

    31,011
    6,922
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,428
    Local Time:
    7:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    not exactly curl on optimized version of that image shows 25696 bytes
    Code:
    curl -I https://gtmetrix.com/reports/ps.amebae.com/fx7AD6Aj/pagespeed/fit_204x157_baloon_payment_header_image_4dc5f5f6b76b19b54e2e1d9d6198a720.png
    HTTP/1.1 200 OK
    Date: Wed, 23 Dec 2015 16:12:53 GMT
    Server: Apache
    Last-Modified: Wed, 23 Dec 2015 16:09:49 GMT
    Content-Length: 25696
    X-Content-Type-Options: nosniff
    Cache-Control: max-age=31536000
    Content-Type: image/png
    Strict-Transport-Security: max-age=15768000; includeSubDomains; preload
    so larger than ngx_pagespeed's 25572 bytes heh
     
  10. xhash

    xhash New Member

    6
    1
    3
    Dec 24, 2015
    Ratings:
    +1
    Local Time:
    8:18 AM
    1.9.9
    10.0.23-MariaDB MariaDB Server
    Thanks Eva, you've been extremely helpful, ill be able to take it from here.
     
    • Like Like x 1
  11. eva2000

    eva2000 Administrator Staff Member

    31,011
    6,922
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,428
    Local Time:
    7:18 AM
    Nginx 1.13.x
    MariaDB 5.5
    enjoy :D