MrTschi commented on issue #1944: XMLHttpRequest got not rewritten URL: https://github.com/apache/incubator-pagespeed-mod/issues/1944#issuecomment-529103192 @Lofesa thanks for your help. What still confuses me is the fact, that normal images got rewritten by pagespeed when requested as "XMLHttpRequest" but divs with style "background-image" with image-url will not get optimized: **Simulate AJAX-Request with curl:** ``` $ curl --silent 'https://www.living-zone.de/widgets/emotion/index/emotionId/19/controllerName/index' -XGET -H 'X-Requested-With: XMLHttpRequest' ``` Result: Pagespeed does not rewrite background images ``` [...] <div [...] style="background-image:url(https://www.living-zone.de/media/image/2c/4f/02/Gartebnmobel-topseller.jpg)"> [...] ``` But rewrites normal <img> images so it does something: ``` <img src="https://www.living-zone.de/media/image/84/f9/9a/xedelstahl_essgruppe_bilbao_8_160_220_schwarz_01_420x420.jpg.pagespeed.ic.bm9NefcOzU.jpg" [...]/> ``` **"Normal" page calls without the XMLHttpRequest header will work:** ``` $ curl --silent 'https://www.living-zone.de/widgets/emotion/index/emotionId/19/controllerName/index' -XGET |grep background-image ``` Result: Pagespeed will also rewrite background images: ``` [...] <div [...] style="background-image:url(https://www.living-zone.de/media/image/7f/26/d6/xGartenmobel-Ausverkauf.jpg.pagespeed.ic.WKw6ZP9R7j.jpg)"> [...] ```
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services