Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Combined CSS file not rewritten by CSS filter (not minified nor sub-resources rewritten) #623

Closed
GoogleCodeExporter opened this issue Apr 6, 2015 · 17 comments

Comments

@GoogleCodeExporter
Copy link

What is the expected output? What do you see instead?

Expected: single compressed, minified, joined CSS file.

Result: files before offending CSS directive are joined, NOT minified, not 
compressed, directives inside comments, e.g., background-image url, rewritten; 
files, starting with the one containing offending CSS directive inside a 
comment, and subsequent ones are compressed, joined, minified, i.e., processed 
correctly!

Example URL:

http://clubsilver.org, but any page should display the same problem.

Note that the .cc. file is not rewritten by the CSS filter .cf.:

<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/1140.css+b.css+s.css.pagespeed.cc.
lAxdVVrOl3.css"/>
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/W.n.css.pagespeed.cf.ueF640y40H.cs
s"/>

Split off of issue 622.

Original issue reported on code.google.com by sligocki@google.com on 19 Feb 2013 at 6:16

@GoogleCodeExporter
Copy link
Author

This looks like it's working to me. I get:

<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.1140.css+b.css+s.css,Mcc.lAxdVVr
Ol3.css.pagespeed.cf.6NXa7Hw0um.css"/>
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.n.css.pagespeed.cf.ueF640y40H.cs
s"/>

The ".pagespeed.cf." in the first resource tells me that it is in fact being 
minified and subresources rewritten. Perhaps the version you got had not 
stabilized yet?

Original comment by sligocki@google.com on 19 Feb 2013 at 6:22

  • Changed state: NotReproducible

@GoogleCodeExporter
Copy link
Author

Still does not work for me. The CSS resource with 1140.css does not get 
minified or rewritten, when followed with n.css with commented out @include. I 
can refresh all day long and watch the files be re-assembled after clearing out 
the cache. The first half of the resulting CSS (contains 1140.css) is not 
completely processed. I tried it on Windows, Linux with Chrome and Opera (not 
that I expected a browser to make a difference).

P.S. I know that removing @include from or moving n.css before 1140.css will 
fix it, i.e., there will only be one resulting CSS file and CSS will be 
processed completely.

Original comment by webmas...@clubsilver.org on 19 Feb 2013 at 7:27

@GoogleCodeExporter
Copy link
Author

Hm, that is odd. If I request this page from the command line (using curl), I 
get the fully minified/rewritten version, if I do it from Chrome, I get the 
non-minified version (as you mentioned).

Original comment by sligocki@google.com on 19 Feb 2013 at 7:56

  • Changed state: New

@GoogleCodeExporter
Copy link
Author

Confirmed, this is User-Agent-dependant:

With Chrome-like User-Agent:

$ curl --user-agent "Mozilla/5.0 (X11; Linux x86_64) Chrome/25.0.1364.84" -s 
http://www.clubsilver.org/ | grep css | grep pagespeed<link rel="stylesheet" 
type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/1140.css+b.css+s.css.pagespeed.cc.
lAxdVVrOl3.css"/>
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/W.n.css.pagespeed.cf.ueF640y40H.cs
s"/>
<link rel="stylesheet" 
href="http://dup3oj30j7iey.cloudfront.net/W._,Mco.oqO9VTUB53.css.pagespeed.cf.Lx
spI5K2Q6.css" type="text/css">

With slightly more generic UA:

$ curl --user-agent "Mozilla/5.0 (X11; Linux x86_64)" -s 
http://www.clubsilver.org/ | grep css | grep pagespeed
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.1140.css+b.css+s.css,Mcc.lAxdVVr
Ol3.css.pagespeed.cf.6NXa7Hw0um.css"/>
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.n.css.pagespeed.cf.ueF640y40H.cs
s"/>
<link rel="stylesheet" 
href="http://dup3oj30j7iey.cloudfront.net/A._,Mco.oqO9VTUB53.css.pagespeed.cf.Lx
spI5K2Q6.css" type="text/css">


So this is not serving the rewritten version for some UAs.

Do you have any caching or other layer between mod_pagespeed and users that 
might be caching an old version for some recognized User-Agents? I can't think 
of how this could be happening in mod_pagespeed (although I'll try to reproduce 
it locally).

Original comment by sligocki@google.com on 19 Feb 2013 at 8:05

@GoogleCodeExporter
Copy link
Author

Yes, confirmed it here as well. Let me check if it is not mod_security issue.

Original comment by webmas...@clubsilver.org on 19 Feb 2013 at 8:09

@GoogleCodeExporter
Copy link
Author

Nothing pops-out right away with mod_security but since my IP address is 
definitely white listed and yours may or may not have been since before, it 
would seem to me that it is UA related? Anything to do with "Vary: 
Accept-Encoding,User-Agent"  in HTML page response header?

Original comment by webmas...@clubsilver.org on 19 Feb 2013 at 8:25

@GoogleCodeExporter
Copy link
Author

I cannot reproduce this on my system and I can't think of anything in MPS that 
would act this way. This seems to me like it has to be something in front of 
MPS, maybe a CDN or caching layer of some sort on your system.

Original comment by sligocki@google.com on 19 Feb 2013 at 9:48

  • Changed state: NotReproducible

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

To add to your earlier comment, there is no other cache in front of Apache.

Original comment by webmas...@clubsilver.org on 19 Feb 2013 at 11:10

@GoogleCodeExporter
Copy link
Author

Disabling domain re-writing to CDN fixes it.

Original comment by webmas...@clubsilver.org on 19 Feb 2013 at 11:43

@GoogleCodeExporter
Copy link
Author

Hm, I still can't reproduce this with sharding or rewriting domains

Original comment by sligocki@google.com on 22 Feb 2013 at 11:59

@GoogleCodeExporter
Copy link
Author

Testing multiple versions (curl, default UA) with a fresh cache. Checked the 
latest beta as well. Same config, same HTML, but had to disable inline_css to 
force outlining the files.

mod-pagespeed-stable-1.1.23.2-2258.i386

<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.1140.css.pagespeed.cf.l-odg1sB_e
.css"/>
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.b.css.pagespeed.cf.ov6NqFUA7w.cs
s"/>
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.s.css.pagespeed.cf.dtIxfDsDDC.cs
s"/>
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.n.css.pagespeed.cf.ueF640y40H.cs
s"/>


mod-pagespeed-beta-1.3.25.2-2530.i386

<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.1140.css+b.css+s.css,Mcc.yeaCCmM
CTz.css.pagespeed.cf.eN-yuaoCm4.css"/>
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.n.css.pagespeed.cf.CPRqLxHUPc.cs
s"/>


mod-pagespeed-beta-1.2.24.1-2300

<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.1140.css+b.css+s.css,Mcc.yeaCCmM
CTz.css.pagespeed.cf.OAnVsExiAI.css"/>
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.n.css.pagespeed.cf.ueF640y40H.cs
s"/>


The only log line of notice is this:

[pagespeed:info] [pid 30764:tid 2809133936] [mod_pagespeed 1.2.24.1-2300 
@30764] Cannot combine: not combinable


but I do not know what it refers to.

Original comment by webmas...@clubsilver.org on 23 Feb 2013 at 7:47

@GoogleCodeExporter
Copy link
Author

Weird. If I am reading right, there are two possible reasons for this message:
1) It can't parse one of the CS files. In that case you should have an another 
info message, something like "Failed to combine (whatever) because of parse 
error"
2) The 2nd file looking like it has an @import (which it doesn't).


Original comment by morlov...@google.com on 25 Feb 2013 at 1:58

@GoogleCodeExporter
Copy link
Author

I checked the logs for the message I quoted and printed it below in context. It 
seems that the message refers to JS files, rather than CSS? I do not see any 
'Failed to combine ...' messages.

...

[Sun Feb 24 00:42:03.871532 2013] [pagespeed:info] [pid 30787:tid 2916031344] 
[mod_pagespeed 1.2.24.1-2300 @30787] No permission to rewrite 
'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'
[Sun Feb 24 00:42:03.871691 2013] [pagespeed:info] [pid 30787:tid 2916031344] 
[mod_pagespeed 1.2.24.1-2300 @30787] No permission to rewrite 
'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'
[Sun Feb 24 00:42:03.872096 2013] [pagespeed:info] [pid 30787:tid 2916031344] 
[mod_pagespeed 1.2.24.1-2300 @30787] No permission to rewrite 
'http://www.clubsilver.org/images/nojs.gif'
[Sun Feb 24 00:42:03.872826 2013] [pagespeed:info] [pid 30787:tid 2916031344] 
[mod_pagespeed 1.2.24.1-2300 @30787] No permission to rewrite 
'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'
[Sun Feb 24 00:42:03.872925 2013] [pagespeed:info] [pid 30787:tid 2916031344] 
[mod_pagespeed 1.2.24.1-2300 @30787] No permission to rewrite 
'http://www.clubsilver.org/images/nojs.gif'

[Sun Feb 24 00:42:03.880965 2013] [pagespeed:info] [pid 30787:tid 2811231088] 
[mod_pagespeed 1.2.24.1-2300 @30787] Cannot combine: not combinable

[Sun Feb 24 00:42:03.883903 2013] [pagespeed:info] [pid 30787:tid 2792356720] 
[mod_pagespeed 1.2.24.1-2300 @30787] Starting to rewrite images in CSS in 
http://www.clubsilver.org/
[Sun Feb 24 00:42:03.884408 2013] [pagespeed:info] [pid 30787:tid 2792356720] 
[mod_pagespeed 1.2.24.1-2300 @30787] http://www.clubsilver.org/:47: 
Successfully rewrote CSS file http://www.clubsilver.org/ saving 590 bytes.
[Sun Feb 24 00:42:03.884475 2013] [pagespeed:info] [pid 30787:tid 2792356720] 
[mod_pagespeed 1.2.24.1-2300 @30787] Starting to rewrite images in CSS in 
http://www.clubsilver.org/
[Sun Feb 24 00:42:03.884538 2013] [pagespeed:info] [pid 30787:tid 2792356720] 
[mod_pagespeed 1.2.24.1-2300 @30787] http://www.clubsilver.org/:241: 
Successfully rewrote CSS file http://www.clubsilver.org/ saving 1 bytes.
[Sun Feb 24 00:42:03.884598 2013] [pagespeed:info] [pid 30787:tid 2792356720] 
[mod_pagespeed 1.2.24.1-2300 @30787] Starting to rewrite images in CSS in 
http://www.clubsilver.org/

Original comment by webmas...@clubsilver.org on 25 Feb 2013 at 4:11

@GoogleCodeExporter
Copy link
Author

I would like to send a config file privately to one of you. Who do I send it to?

Original comment by webmas...@clubsilver.org on 25 Feb 2013 at 4:12

@GoogleCodeExporter
Copy link
Author

Webmaster, It looks like the combined files are being minified in the new 
versions you posted, do you confirm?

Maks, n.css does contain @import (in a comment). That's why they are not 
combined. Amusingly CSS minifier strips that comment, so the pagespeed.cf. 
version doesn't have it. This is the problem noted in issue 622.

This issue is for the fact that the .pagespeed.cc. file doesn't get minfied by 
CSS filter.

Original comment by sligocki@google.com on 27 Feb 2013 at 3:16

@GoogleCodeExporter
Copy link
Author

On second thought, my #13 test was incomplete since I tested it with curl only, 
rather than including Chrome. We already established that it works with curl.

Here is the latest test with both user agents and 
mod-pagespeed-beta-1.2.24.1-2300,

Default curl :

<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.1140.css+b.css,Mcc.pruXt0JtDH.cs
s.pagespeed.cf.096Bd4z0N-.css"/>
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/A.n.css+s.css,Mcc.kdtXTAle0P.css.p
agespeed.cf.tBHrsuMNZ2.css"/>


Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) 
Chrome/25.0.1364.97 Safari/537.22 :

<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/1140.css+b.css.pagespeed.cc.pruXt0
JtDH.css"/>
<link rel="stylesheet" type="text/css" 
href="http://dup3oj30j7iey.cloudfront.net/css/n.css+s.css.pagespeed.cc.kdtXTAle0
P.css"/>

Original comment by webmas...@clubsilver.org on 27 Feb 2013 at 4:24

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant