You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pagespeed.apache.org by GitBox <gi...@apache.org> on 2022/04/01 12:53:59 UTC

[GitHub] [incubator-pagespeed-ngx] mch0lic edited a comment on issue #1742: 1.13.35.2-stable suddenly stopped working

mch0lic edited a comment on issue #1742:
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1742#issuecomment-1085862951


   Issues with pagespeed were put on hold for some time and I've just took another look at it. The issue still remains with img.domain.com.
   
   Since my last comment, I've moved img.domain.com to completely separate server (it was on the same server as www.domain.com before). Pagespeed is not setup on that server.
   
   www.domain.com the following configuration (recap):
   
   ```
   pagespeed on;
   pagespeed FetchHttps enable;
   pagespeed SslCertDirectory /etc/ssl/certs;
   pagespeed Domain https://www.domain.com;
   pagespeed MapProxyDomain "https://www.domain.com/img/" "https://img.domain.com";
   
   # Disable version reporting.
   pagespeed XHeaderValue "pagespeed";
   
   # Prevent optimizations for selected paths.
   pagespeed Disallow "*?wc-api=*";
   pagespeed Disallow "*?kdfilter=1*";
   pagespeed Disallow "*/wp-json/*";
   
   # Cache
   pagespeed FileCachePath /dev/shm/ngx_pagespeed_cache;
   pagespeed FileCacheSizeKb 307200; # 300mb
   pagespeed HttpCacheCompressionLevel 0;
   
   # Admin console
   pagespeed Statistics on;
   pagespeed StatisticsLogging on;
   pagespeed LogDir /var/log/pagespeed;
   pagespeed AdminPath /pagespeed_admin;
   pagespeed EnableCachePurge on;
   pagespeed PreserveUrlRelativity on;
   
   location ~ "^/pagespeed_admin" {
       allow 127.0.0.1;
       deny all;
   }
   
   # Ensure requests for pagespeed optimized resources go to the pagespeed
   # handler and no extraneous headers get set.
   location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
       add_header "" "";
   }
   
   location ~ "^/ngx_pagespeed_static/" { }
   location ~ "^/ngx_pagespeed_beacon" { }
   
   pagespeed RewriteLevel PassThrough;
   pagespeed EnableFilters add_instrumentation;
   pagespeed EnableFilters extend_cache;
   pagespeed DisableRewriteOnNoTransform off;
   
   pagespeed EnableFilters insert_dns_prefetch;
   pagespeed EnableFilters inline_javascript;
   pagespeed JsInlineMaxBytes 2048; # 2kb
   pagespeed EnableFilters inline_css;
   pagespeed CssInlineMaxBytes 2048; # 2kb
   pagespeed EnableFilters convert_gif_to_png,recompress_png;
   pagespeed EnableFilters convert_jpeg_to_progressive,recompress_jpeg;
   pagespeed EnableFilters convert_jpeg_to_webp,convert_to_webp_lossless,convert_to_webp_animated,recompress_webp;
   pagespeed EnableFilters inline_images,resize_images;
   pagespeed EnableFilters sprite_images;
   pagespeed EnableFilters lazyload_images;
   pagespeed LazyloadImagesAfterOnload off;
   ```
   
   Not sure of this of any help but this is typical with all img.domain.com files:
   
   ```
   [Fri, 01 Apr 2022 12:09:16 GMT] [Info] [668435] <...> Shrinking image `https://img.domain.com/3b68450e-44ba-4f7d-a7b3-dff8178eb5c9/250x250/352195jpg.jpg' (19599 bytes) to `https://www.domain.com/img/3b68450e-44ba-4f7d-a7b3-dff8178eb5c9/250x250/x352195jpg.jpg.pagespeed.ic.FnOL3MV8jb.webp' (7202 bytes)
   [Fri, 01 Apr 2022 12:09:33 GMT] [Warning] [668435] [x352195jpg.jpg:0] Resource based on http://www.domain.com/img/3b68450e-44ba-4f7d-a7b3-dff8178eb5c9/250x250/352195jpg.jpg but cannot access the original
   ```
   
   I understand that first log line says that pagespeed managed to download and compress the file, I can also see a file present in /dev/shm/ngx_pagespeed_cache/v3/domain.com/https,3A/,2Fwww.domain.com/img/c4cfe5b0-1373-4bbf-86d2-39921659dd9b/250x250:
   
   `-rw------- 1 www-data www-data 7410 bal.    1 15:09 x3493651jpg.jpg.pagespeed.ic.JqkCRV6dWY.webp,`
   
   The second log line is generated after subsequent page load, key observations:
   1. Pagespeed replaces https://img.domain.com/3b68450e-44ba-4f7d-a7b3-dff8178eb5c9/250x250/352195jpg.jpg with optimized image pointing to https://www.domain.com/img/3b68450e-44ba-4f7d-a7b3-dff8178eb5c9/250x250/x352195jpg.jpg.pagespeed.ic.FnOL3MV8jb.webp
   2. Image does not load (404)
   3. Directory http://www.domain.com/img/ is not present on the server. This is a MapProxyDomain not an actual directory with files. So oviously the file it tries to find its not there.
   4. For some reason it also tries http not https?
   5. There is a file present in /dev/shm/ngx_pagespeed_cache/v3/domain.com/**http**,3A/,2Fwww.domain.com/img/3b68450e-44ba-4f7d-a7b3-dff8178eb5c9/250x250:
   
   `-rw------- 1 www-data www-data 173 bal.    1 15:42 352195jpg.jpg,`
   
   It seems to me that the pagespeed downloads the file, creates webp but cached file is not loaded on subsequent requests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pagespeed.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org