apache / incubator-pagespeed-mod

Apache module for rewriting web pages to reduce latency and bandwidth.
http://modpagespeed.com
Apache License 2.0
696 stars 158 forks source link

the trim_url should also trim urls in the combined or generated JS/CSS #1668

Open debanjanbasu opened 7 years ago

debanjanbasu commented 7 years ago

The trim_url should also trim urls in the combined or generated JS/CSS. At the moment, it I am proxying my CDNs for optimization. They seem to cause issues at the moment. A part of my config is:

pagespeed Domain ec2-13-55-44-192.ap-southeast-2.compute.amazonaws.com; pagespeed MapProxyDomain http://ec2-13-55-44-192.ap-southeast-2.compute.amazonaws.com/cdnwebapp https://5lx4xixnt5h5s-cdn-webapp.azureedge.net; pagespeed MapProxyDomain http://ec2-13-55-44-192.ap-southeast-2.compute.amazonaws.com/cdnstorage https://5lx4xixnt5h5s-cdn-storage.azureedge.net; pagespeed MapProxyDomain http://ec2-13-55-44-192.ap-southeast-2.compute.amazonaws.com/azurewebsite https://5lx4xixnt5h5s-site.azurewebsites.net;

Is there any way to fix this. I have already tried to trim_url, which does help a lot. But not for urls inside the CSS.

debanjanbasu commented 7 years ago

At the moment, the URLs written are still absolute. Even with rewrite_css and trim_urls and all other params turned on. Here are the enabled filters:

pagespeed RewriteLevel CoreFilters; pagespeed Disallow "*.svg"; pagespeed EnableFilters prioritize_critical_css,defer_javascript,sprite_images,convert_png_to_jpeg,convert_jpeg_to_webp,collapse_whitespace,remove_comments,outline_css,outline_javascript,move_css_above_scripts,rewrite_style_attributes,make_google_analytics_async,make_show_ads_async,inline_google_font_css,local_storage_cache,convert_to_webp_animated,hint_preload_subresources,in_place_optimize_for_browser,responsive_images,resize_images,responsive_images_zoom,lazyload_images,insert_dns_prefetch,extend_cache_pdfs,combine_javascript,move_css_to_head,combine_heads,trim_urls,inline_css;