mch0lic commented on issue #1742:
URL: 
https://github.com/apache/incubator-pagespeed-ngx/issues/1742#issuecomment-954451236


   > Try https://domain.com/?PageSpeedFilters=+debug. and see in the html code 
inserted debug messages as comments.
   
   ```
     <img width="284" 
       height="284" 
       itemprop="image" 
       
src="https://www.domain.com/img/2c1eb6db-316a-4959-9767-9d82613949f4/284x284/xtastingbox1-openjpg.jpg.pagespeed.ic.iVO7SrJwHL.webp";
 
       class="attachment-shop_single size-shop_single image-without-video" 
       alt="" 
       
data-src="https://www.domain.com/img/2c1eb6db-316a-4959-9767-9d82613949f4/284x284/xtastingbox1-openjpg.jpg.pagespeed.ic.iVO7SrJwHL.webp";
 
       
data-large_image="https://img.domain.com/2c1eb6db-316a-4959-9767-9d82613949f4/284x284/tastingbox1-openjpg.jpg";
 
       data-color="default" 
       data-large_image_width="925" 
       data-large_image_height="925" 
       data-pagespeed-url-hash="339213084" 
       onload="pagespeed.CriticalImages.checkImageForCriticality(this);">
   
     <!--Image 
https://img.domain.com/2c1eb6db-316a-4959-9767-9d82613949f4/284x284/tastingbox1-openjpg.jpg
 does not appear to need resizing.-->
     <!--The image was not inlined because you have chosen to only inline the 
critical images but this image is not critical.-->
     <!--Image 
https://img.domain.com/2c1eb6db-316a-4959-9767-9d82613949f4/284x284/tastingbox1-openjpg.jpg
 does not appear to need resizing.-->
     <!--The image was not inlined because you have chosen to only inline the 
critical images but this image is not critical.-->
   ```
   
   Even though urls are rewritten and it seems pagespeed is attempting to serve 
webp I still get 404 though:
   
   <img width="859" alt="Screenshot 2021-10-29 at 09 29 36" 
src="https://user-images.githubusercontent.com/1477518/139380984-fde04038-872a-41df-a36f-2451015be15d.png";>
   
   > Is img.domain.com running pagespeed? If no, then you don´t need the Domain 
directive/
   
   img.domain.com is pointing to another server, it does not run pagespeed 
indeed.
   
   > If in your html code there is a https://img.domain.com/some-image.jpg, 
with this directive these url is rewrited to some like 
https://img.domain.com/xsome-image.jpg.SOMEHAS.jpg (or webp)
   
   This is not correct, the https://img.domain.com/some-image.jpg will be 
rewritten into https://**www**.domain.com/**img**/xsome-image.jpg.SOMEHASH.jpg 
and if I understand correctly it's cached on the server where pagespeed is 
enabled (www.domain.com).
   
   > with pagespeed FetchHttps enable; you need to enable other directive 
pagespeed SslCertDirectory directory; as you say is Ubuntu directory sould be 
/etc/ssl/certs
   
   Please see the updated config at the end of the comment.
   
   > And I can´t see a pagespeed Domain domain.com; and the docs say "In 
addition to optimizing HTML resources, PageSpeed restricts itself to optimizing 
resources (JavaScript, CSS, images) that are served from domains, with optional 
paths, that must be explicitly listed in the configuration file. "
   
   I've tried both www.domain.com and domain.com, but it doesn't seem to work.
   ```
   <script defer="" type="text/javascript" 
src="https://www.domain.com/app/plugins/woocommerce/assets/js/jquery-blockui/jquery.blockUI.min.js?ver=2.7.0-wc.5.6.0";
 id="jquery-blockui-js"></script>
   <!--The preceding resource was not rewritten because its domain 
(www.domain.com) is not authorized-->
   ```
   
   ```
   pagespeed on;
   pagespeed XHeaderValue "ngx_pagespeed";
   pagespeed RewriteLevel PassThrough;
   pagespeed FileCachePath /dev/shm/ngx_pagespeed_cache;
   pagespeed FileCacheSizeKb 307200;
   pagespeed Statistics on;
   pagespeed StatisticsLogging on;
   pagespeed EnableCachePurge on;
   pagespeed LogDir /var/log/pagespeed;
   pagespeed AdminPath /pagespeed_admin;
   pagespeed FetchHttps enable;
   pagespeed SslCertDirectory /etc/ssl/certs;
   
   pagespeed LoadFromFile "https://www.domain.com/app/uploads/"; 
"/var/www/www.domain.com/shared/uploads/";
   pagespeed LoadFromFile "https://www.domain.com/app/plugins/"; 
"/var/www/www.domain.com/current/web/app/plugins/";
   pagespeed LoadFromFile "https://www.domain.com/app/themes/"; 
"/var/www/www.domain.com/current/web/app/themes/";
   
   pagespeed Domain www.domain.com;
   pagespeed MapProxyDomain https://www.domain.com/img/ https://img.domain.com/;
   
   # Filters
   pagespeed EnableFilters add_instrumentation;
   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 extend_cache;
   pagespeed EnableFilters sprite_images;
   pagespeed EnableFilters insert_dns_prefetch;
   pagespeed EnableFilters lazyload_images;
   pagespeed LazyloadImagesAfterOnload off;
   pagespeed EnableFilters inline_css;
   pagespeed CssInlineMaxBytes 2048; # 2kb
   pagespeed EnableFilters inline_javascript;
   pagespeed JsInlineMaxBytes 2048; # 2kb
   pagespeed UrlValuedAttribute img data-imgs image;
   pagespeed UrlValuedAttribute img data-imgm image;
   pagespeed UrlValuedAttribute img data-imgd image;
   pagespeed UrlValuedAttribute img data-desktop-src image;
   pagespeed UrlValuedAttribute img data-mobile-src image;
   pagespeed UrlValuedAttribute img data-mobile-slider-src image;
   pagespeed UrlValuedAttribute source srcset image;
   
   # 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" { }
   location ~ "^/pagespeed_admin" { allow 127.0.0.1; deny all; }
   ```


-- 
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-unsubscr...@pagespeed.apache.org

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


Reply via email to