apache / incubator-pagespeed-ngx

Automatic PageSpeed optimization module for Nginx
http://ngxpagespeed.com/
Apache License 2.0
4.37k stars 365 forks source link

Some CSS didn't successfully merged #572

Open draskolnikova opened 10 years ago

draskolnikova commented 10 years ago

Nginx: 1.4.3 Pagespeed: 1.7.30.1

URL: http://unik-aneh.lintas.me/article/muslimpos.net/inilah-5-fakta-ajaib-tentang-adzan/0/&skip_load=1

List of CSS: http://unik-aneh.lintas.me/assets/foundation/css/foundation.min.css http://unik-aneh.lintas.me/assets/foundation/css/offcanvas.css http://www.lintas.me/style/newlintasme_style/global.css http://www.lintas.me/style/newlintasme_style/facebox.css http://www.lintas.me/assets/styles/font-face.css http://www.lintas.me/style/newlintasme_style/mCustomScrollbar.css http://www.lintas.me/style/newlintasme_style/joyride.css

Pagespeed Configuration :

pagespeed EnableFilters rewrite_images,lazyload_images;
pagespeed EnableFilters inline_preview_images,resize_mobile_images;
pagespeed EnableFilters convert_jpeg_to_progressive;
pagespeed EnableFilters recompress_images,recompress_jpeg,recompress_png;
pagespeed EnableFilters convert_jpeg_to_progressive;
pagespeed EnableFilters rewrite_css,sprite_images;
pagespeed EnableFilters rewrite_javascript,rewrite_style_attributes_with_url,rewrite_style_attributes;
pagespeed EnableFilters trim_urls;
pagespeed EnableFilters combine_css,combine_javascript;
pagespeed EnableFilters insert_dns_prefetch;
pagespeed EnableFilters insert_image_dimensions;
pagespeed EnableFilters strip_image_color_profile,strip_image_meta_data;

There is no disabled css/js merge on the configuration above.

oschaaf commented 10 years ago

@at-
Do you see any errors or warnings in /ngx_pagespeed_message? Could your try if adding pagespeed EnableFilters fallback_rewrite_css_urls; helps? For example, http://unik-aneh.lintas.me/hot/Ahok-Lawan-Gerindra/?PageSpeedFilters=rewrite_css,fallback_rewrite_css_urls gets optimized (though not combined)

One thing I noticed, is that the response for this pagespeed resource from your cdn looks malformed: http://cdn.lintas.me/images/publisher/foundation/foundation_icons_all/foundation_icons_social/stylesheets/A.social_foundicons.css.pagespeed.cf.61Ps-A94BZ.css

Who is rewriting those? Did the configuration change?

draskolnikova commented 10 years ago

@oschaaf

The pages are broken if I add the

pagespeed EnableFilters fallback_rewrite_css_urls

Something wrong?

All rewrited files by pagespeed. And there is no configuration changes.

And, my ngx_pagespeed_message show this :

Writing to ngx_pagespeed_message failed. Please check if it's enabled in pagespeed.conf. 

Here is my ngx configuration :

        location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; }
        location ~ "^/ngx_pagespeed_static/" { }
        location ~ "^/ngx_pagespeed_beacon$" { }
        location /ngx_pagespeed_statistics { allow 127.0.0.1; allow 202.77.113.216/29; allow 103.29.150.0/29; allow 103.8.78.236; deny all; }
        location /ngx_pagespeed_message { allow 127.0.0.1; allow 202.77.113.216/29; allow 103.29.150.0/29; allow 103.8.78.236; deny all; }
oschaaf commented 10 years ago

@at- Looking at the response headers for: http://unik-aneh.lintas.me/article/muslimpos.net/inilah-5-fakta-ajaib-tentang-adzan/0/&skip_load=1

I see: X-Mod-Pagespeed:1.7.30.1-3609

Which confuses me a little. Is Apache with mod_pagespeed involved as well next to ngx_pagespeed? What are you trying to achieve? Looking at view-source:http://unik-aneh.lintas.me/article/muslimpos.net/inilah-5-fakta-ajaib-tentang-adzan/0/&skip_load=1?PageSpeed=off, I don't get any assets in the html pointing to the cdn, which makes me thing someone else must be rewriting them?

As for /ngx_pagespeed_message not working, I think you are hitting: https://github.com/pagespeed/ngx_pagespeed/issues/559 This is fixed on master, could you try that?

draskolnikova commented 10 years ago

Yes, behind ngx_pagespeed is mod_pagespeed exist, but I've disabled css rewrite on the root configuration of mod_pagespeed. Should I enable them (mod_pagespeed css rewrite ) ?

But, if you see at homepages (www.lintas.me). I see the rewritten css was there http://www.lintas.me/A.style,,_newlintasme_style,,_global.css+style,,_newlintasme_style,,_facebox.css+assets,,_styles,,_font-face.css+style,,_newlintasme_style,,_joyride.css+style,,_newlintasme_style,,_mCustomScrollbar.css+style,,_newlintasme_style,,_global-v4b.css,Mcc.2xU5KfKfWa.css.pagespeed.cf.bIskektOxY.css

oschaaf commented 10 years ago

@at- Re: "Yes, behind ngx_pagespeed is mod_pagespeed exist, but I've disabled css rewrite on the root configuration of mod_pagespeed. Should I enable them (mod_pagespeed css rewrite ) ?"

I'm still not sure what you are trying to achieve? You should be able to disable rewriting completely for proxied requests to the mod_pagespeed enabled origin by adding proxy_set_header PageSpeed off; after the proxy_pass lines(s) in nginx.conf

That way, you can configure ngx_pagespeed do all the pagespeed optimization. Is that what you want?

draskolnikova commented 10 years ago

@oschaaf

I made a tricks that HTML resources optimized by mod_pagespeed and static resource optimized by ngx_pagespeed. I can't set

proxy_set_header PageSpeed off;
right now. Because it's production servers. Is there any way to tracing it? And why other csses are normal? The example are posted before this post.