incubator-pagespeed-ngx
incubator-pagespeed-ngx copied to clipboard
again the error: [ngx_pagespeed 1.13.35.2-0] PageSpeed Serf fetch failure rate extremely high; only 0 of 44 recent fetches fully successful; is fetching working?
Hi again here, but I write to find a solution to this error:
2018/05/17 11:17:16 [error] 1731#5159: [ngx_pagespeed 1.13.35.2-0] PageSpeed Serf fetch failure rate extremely high; only 0 of 44 recent fetches fully successful; is fetching working? 2018/05/17 13:05:20 [error] 1731#5159: [ngx_pagespeed 1.13.35.2-0] PageSpeed Serf fetch failure rate extremely high; only 0 of 44 recent fetches fully successful; is fetching working? 2018/05/17 17:56:56 [error] 1731#5159: [ngx_pagespeed 1.13.35.2-0] PageSpeed Serf fetch failure rate extremely high; only 0 of 89 recent fetches fully successful; is fetching working?
this is my current configuration:
listen 443 ssl http2; server_name myapp.domain.com pagespeed on; pagespeed FetchHttps enable; pagespeed FileCachePath /var/ngx_pagespeed_cache; pagespeed EnableFilters rewrite_css; pagespeed EnableFilters fallback_rewrite_css_urls; pagespeed EnableFilters combine_css; location ~ ".pagespeed.([a-z].)?[a-z]{2}.[^.]{10}.[^.]+" { add_header "" ""; } location ~ "^/ngx_pagespeed_static/" { } location ~ "^/ngx_pagespeed_beacon" { } pagespeed LoadFromFile "https://www.domain.com" "/var/www/webapp/"; pagespeed LoadFromFileRuleMatch disallow .; pagespeed LoadFromFileRuleMatch allow .(ico|pdf|swf|eot|woff|ttf|otf|css|js|jpeg|jpg|png|gif|svg|svgz|mpg|mpeg|mp3|m4a|m4v|mp4|ogg|wmv|mov|mng|3gpp|3gp|webp|webm|flv|avi|asx|asf) (?.)?$;
I hope a little help, I'm not an expert in pagespeed :)
In https://github.com/apache/incubator-pagespeed-ngx/issues/1562#issuecomment-389434823 @Lofesa said:
pagespeed LoadFromFileRuleMatch disallow .*; is the rigth statement to disallow all files.
It looks like you didn't try that?
hi, I have it in my configuration, here is omitting the asterisk , look:

Hi I use letsencrypt too b but the ssl config diectives I use the standar ssl that comes with centos. I see in your error log that none of the fetches are rigth, that make me think is a missconfiguration. What happend when you try the /?PageSpeedFiltes=+debug (you need to look at the generated html code)?
Hi Lofesa , you recommend me to put this configuration and remove the one from letsencrypt:
pagespeed SslCertDirectory / etc / pki / tls / certs; pagespeed SslCertFile /etc/pki/tls/cert.pem;
I can not find the correct syntax to debug?
Yes, if these paths are valid for your distro, for me are ok on a centos 7. For debug pagespeed, in your browser you can add these params, like https://www.mydomain.com/?PageSpeedFilters=+debug and then look at the generated html code. You can see some debug messages in it.
Hi Lofesa , I made the change, I'm also using centos 7, debug mode I see many 404 or files that do not exist, I think you have to debug the page and remove links that do not exist.
Is the debug correct?

Yes, these are the ok params but you need to look not at the network tools on chrome. You need to rigth click on the page and choose to view the html code to see pagespeed debug messages. As I can see you use spanish names to image files: Clica con el boton derecho del raton sobre la pagina, en el menu que se despliega elige "Ver codigo fuente de la pagina". Los mensajes de debug los veras en verde.
ok , look the debug message:

what do you think of those messages?
regards !
Well, these messages are saying that the resources headers don´t let pagespeed rewrite these resources. Or the resources are getting a 404 not found or the resources have a header that are not public cacheable. Pagespeed need the resource public cacheable to work. What Cache-control header have these resources?
here I do not have it very well tuned the cache with nginx, I'm still making adjustments
proxy_cache_path /var/nginx/ghostcache levels=1:2 keys_zone=ghostcache:10m max_size=300m inactive=24h; proxy_cache_key "$scheme$request_method$host$request_uri"; proxy_cache_methods GET HEAD;
location / { proxy_cache ghostcache; proxy_cache_valid 10m; proxy_cache_valid 404 1m; proxy_cache_purge 1; proxy_ignore_headers Set-Cookie; proxy_hide_header Set-Cookie; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; proxy_ignore_headers Cache-Control; add_header X-Cache-Status $upstream_cache_status;
Hi
Try to comment these param
proxy_ignore_headers Cache-Control;
and set the header Cache-Control: max-age=
Hi Lofesa , I made the change and added it to the location part
proxy_hide_header Set-Cookie;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
add_header Cache-Control "max-age=604800, public";
add_header X-Cache-Status $upstream_cache_status;
thank you for your patience, but I have a question here do you need to see something, with this change?
Pagespeed need that the resources bacame public cacheable. When you put pagespeed off, the resources must have a cache-control header like that you posted (Cache-Control="max-age=604800, public") You can test it whit https://www.mydomain.com/?PageSpeed=off and look at the headers of resources. In the image you have posted, you have debug messages like
I see the header, although some images like png or some css do not cache


Well, in those resources you don´t have cache-control set to public (or max-age=XXXX) you can expect these debug messages <!--Resource headers are preventing... that you showed in an previous image. In those resources you have set the cache-control you can expect that the resource become rewrited by pagespeed and you can see in the html code like https://www.mysite.com/A.style.css.pagespeed.HASH.css
Hi Lofesa , sorry for delay , I made some changes to the cache part and now I'm caching the jpg, png, css, which I do not know because I see the cache-control header: no-cache , look the image :

based on your experience how you could improve the cache along with pagespeed.
Request headers don´t matter. The ones that ae relevant are the response headers. In the last image you posted, the slide5.png had a valid cache-control : max-age=10800..... but looking in that mage I don´t see any header that sugest the image become optimized by pagespeed, headers like etag: W/"0" , or x-page-speed: 1.13.35.2-0.... Can you post here or send in a private mail a url from your site so I can test it?
How I sent you a private mail on github? , my mail es xserverlinuxatgmail.com
@rickygm , sorry , I forgot that private messages are lost in gibhub. You can send it to lofesa.at.gmail.com
Ok , I send now
i am observing the below logs on mine nginx error. can anybody please help me to resolve this issue
2021/01/12 09:24:56 [error] 2566#2586: [ngx_pagespeed 1.13.35.2-0] http://xxx.xxx.xxx.xxx/ (connecting to:lb1.i):0:Error status=670002 (Name or service not known) serf_connection_create2
i am observing the below logs on mine nginx error. can anybody please help me to resolve this issue
2021/01/12 09:24:56 [error] 2566#2586: [ngx_pagespeed 1.13.35.2-0] http://xxx.xxx.xxx.xxx/ (connecting to:lb1.i):0:Error status=670002 (Name or service not known) serf_connection_create2
The module isn't able to fetch its input resources. It might be good to check https://www.modpagespeed.com/doc/faq#warning-fetch-rate and possibly https://www.modpagespeed.com/doc/https_support
As stated by @oschaaf the pagespeed module is unable to fecht the resource. Maybe you have misconfigured https fechting or maybe you have a name resolution problem.