Seemingly random ERR_RESPONSE_HEADERS_TOO_BIG for minified JS files.

272 views
Skip to first unread message

Ryan Lederman

unread,
Mar 29, 2017, 3:54:40 PM3/29/17
to ngx-pagespeed-discuss
I'm running ngx_pagespeed on Ubuntu 14.10, with varying degrees of success. I have had some difficulties getting the cache functionality to behave properly. Mainly:

In Chrome (on both macOS and Windows), I am getting ERR_RESPONSE_HEADERS_TOO_BIG for some certain minified JavaScript files;
  • constants.min.js
  • semantic.min.js
If I flush the nginx/pagespeed cache:

# flush nginx cache
alias flush-nginx-cache='touch /var/cache/ngx_pagespeed/cache.flush'

It is resolved, for the time being, but it shall return. NOTE: I do not see this error in Postman.

My config is as follows:

proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=spkg_cache:10m max_size=5g inactive=60m use_temp_path=off;

pagespeed on;
pagespeed FileCachePath "/var/cache/ngx_pagespeed";
pagespeed DisableRewriteOnNoTransform off;
pagespeed EnableFilters prioritize_critical_css;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

gzip_proxied no-cache no-store private expired auth;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_types      text/plain
                text/css
                application/json
                application/ld+json
                application/x-javascript
                text/xml
                application/xml
                application/xhtml+xml
                application/xml+rss
                text/javascript
                application/javascript
                image/svg+xml
                font/ttf
                font/otf
                font/opentype
                application/x-font-ttf
                application/x-font-otf
                application/x-font-opentype;

Any help is greatly appreciated.

-- Ryan

Joshua Marantz

unread,
Mar 29, 2017, 5:05:48 PM3/29/17
to ngx-pagesp...@googlegroups.com
Which version of ngx_pagespeed are you running?  If it's 1.11.*, can you upgrade to 1.12.*?  I believe a bug about superfluous "Vary:Accept-Encoding" headers was fixed in that release.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.

Ryan Lederman

unread,
Mar 30, 2017, 3:22:46 PM3/30/17
to ngx-pagesp...@googlegroups.com
Indeed, I am using X-Page-Speed: 1.11.33.4-0, and I was trying to determine the version when I saw the following header in Postman:

`
Vary: Accept-Encoding, Accept-Encoding (repeats dozens of times)
`

I am hesitant to upgrade to the 1.12.34.2-beta build on a production server. I wonder if there’s any tweaks I can make to the configuration instead?
You received this message because you are subscribed to a topic in the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ngx-pagespeed-discuss/OwLgpnXQT8w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ngx-pagespeed-di...@googlegroups.com.

Joshua Marantz

unread,
Mar 30, 2017, 3:35:58 PM3/30/17
to ngx-pagesp...@googlegroups.com
No, but we will at some point push 1.12 to stable anyway.  I'm not sure how long that will take exactly, but I can tell you that we do not plan any more code-changes from the current 1.12 beta.

On Thu, Mar 30, 2017 at 3:22 PM, Ryan Lederman <ry...@getsparkage.com> wrote:
Indeed, I am using X-Page-Speed: 1.11.33.4-0, and I was trying to determine the version when I saw the following header in Postman:

`
Vary: Accept-Encoding, Accept-Encoding (repeats dozens of times)
`

I am hesitant to upgrade to the 1.12.34.2-beta build on a production server. I wonder if there’s any tweaks I can make to the configuration instead?
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsubscri...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ngx-pagespeed-discuss/OwLgpnXQT8w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ngx-pagespeed-discuss+unsubscri...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsubscri...@googlegroups.com.

Ryan Lederman

unread,
Mar 30, 2017, 4:37:40 PM3/30/17
to ngx-pagesp...@googlegroups.com
Well, I did the upgrade against my better judgement ;) now I am getting ERR_CONTENT_DECODING_FAILED on every .svg that the site serves.

Here’s sample response headers for one of the SVGs:

HTTP/1.1 200 OK Content-Type: image/svg+xml Connection: keep-alive Server: nginx/1.11.12 Last-Modified: Fri, 28 Oct 2016 22:14:20 GMT ETag: "5813cdbc-12b6" Pragma: public Accept-Ranges: bytes Date: Thu, 30 Mar 2017 20:33:04 GMT Vary: Accept-Encoding X-Original-Content-Length: 4790 Content-Encoding: gzip Content-Length: 1589 ETag: "5813cdbc-12b6" Pragma: public Cache-Control: max-age=31536000, public, must-revalidate, proxy-revalidate, max-age=31536000, public, must-revalidate, proxy-revalidate, s-maxage=10 Accept-Ranges: bytes

as you can see, the ‘ETag’ and ‘Pragma: public’ are repeated (not sure if this is the issue)

Here’s the attributes pagespeed is putting on those tags: data-pagespeed-url-hash="3244117783" onload="pagespeed.CriticalImages.checkImageForCriticality(this);

I have flushed the cache. Any ideas? I’m going to disable pagespeed until I have a better grasp on what’s happening here.
To unsubscribe from this group and all its topics, send an email to ngx-pagespeed-di...@googlegroups.com.

Otto van der Schaaf

unread,
Mar 30, 2017, 5:15:31 PM3/30/17
to ngx-pagesp...@googlegroups.com
It sounds like you are now running into https://github.com/pagespeed/ngx_pagespeed/issues/1346
You may be able to work around that by adding this configuration snippet:

pagespeed Disallow "*.svg";
 
Otto

On Thu, Mar 30, 2017 at 10:37 PM Ryan Lederman <ry...@getsparkage.com> wrote:
Well, I did the upgrade against my better judgement ;) now I am getting ERR_CONTENT_DECODING_FAILED on every .svg that the site serves.

Here’s sample response headers for one of the SVGs:

HTTP/1.1 200 OK Content-Type: image/svg+xml Connection: keep-alive Server: nginx/1.11.12 Last-Modified: Fri, 28 Oct 2016 22:14:20 GMT ETag: "5813cdbc-12b6" Pragma: public Accept-Ranges: bytes Date: Thu, 30 Mar 2017 20:33:04 GMT Vary: Accept-Encoding X-Original-Content-Length: 4790 Content-Encoding: gzip Content-Length: 1589 ETag: "5813cdbc-12b6" Pragma: public Cache-Control: max-age=31536000, public, must-revalidate, proxy-revalidate, max-age=31536000, public, must-revalidate, proxy-revalidate, s-maxage=10 Accept-Ranges: bytes

as you can see, the ‘ETag’ and ‘Pragma: public’ are repeated (not sure if this is the issue)

Here’s the attributes pagespeed is putting on those tags: data-pagespeed-url-hash="3244117783" onload="pagespeed.CriticalImages.checkImageForCriticality(this);

I have flushed the cache. Any ideas? I’m going to disable pagespeed until I have a better grasp on what’s happening here.


On March 30, 2017 at 13:35:59, 'Joshua Marantz' via ngx-pagespeed-discuss (ngx-pagesp...@googlegroups.com) wrote:

No, but we will at some point push 1.12 to stable anyway.  I'm not sure how long that will take exactly, but I can tell you that we do not plan any more code-changes from the current 1.12 beta.
On Thu, Mar 30, 2017 at 3:22 PM, Ryan Lederman <ry...@getsparkage.com> wrote:
Indeed, I am using X-Page-Speed: 1.11.33.4-0, and I was trying to determine the version when I saw the following header in Postman:

`
Vary: Accept-Encoding, Accept-Encoding (repeats dozens of times)
`

I am hesitant to upgrade to the 1.12.34.2-beta build on a production server. I wonder if there’s any tweaks I can make to the configuration instead?
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ngx-pagespeed-discuss/OwLgpnXQT8w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ngx-pagespeed-di...@googlegroups.com.
Visit this group at https://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.
--

You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ngx-pagespeed-discuss/OwLgpnXQT8w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ngx-pagespeed-di...@googlegroups.com.
Visit this group at https://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

Ryan Lederman

unread,
Mar 30, 2017, 6:09:36 PM3/30/17
to ngx-pagesp...@googlegroups.com
Thank you for that, Otto. That does appear to have alleviated the SVG issue. For the record, I just added what you said:

pagespeed Disallow “*.svg”;

in the nginx configuration.

One thing I noticed is that the image and JavaScript file names do not appear to be modified by pagespeed as they were before; I mean that their names are intact, and aren’t obfuscated with the word ‘pagespeed’ in them when I view the page source.

I am assuming this is because the default filter set has changed since 1.11?

I’m using this config:

   pagespeed on;
   pagespeed Disallow "*.svg";
   pagespeed FileCachePath "/var/cache/ngx_pagespeed";
   pagespeed DisableRewriteOnNoTransform off;
   pagespeed EnableFilters prioritize_critical_css;

I will tinker with it a bit.

Ryan Lederman

unread,
Mar 30, 2017, 6:42:53 PM3/30/17
to ngx-pagesp...@googlegroups.com
Nevermind… it’s now all turned on again. Not sure what changed.
Reply all
Reply to author
Forward
0 new messages