Optimize CSS files returns IE6 styles to IE7 browser.
| Project: | Zen |
| Version: | 6.x-1.0 |
| Component: | CSS/HTML Markup |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Jump to:
Not certain this is Zen-specific -- but I have "Optimize CSS files" turned on to correct the problem of IE not loading all the style sheets, and this works at first, but fails over time.
After several days -- or some period of time -- the IE6-only styles start getting loaded for IE7 browsers. Tested as follows:
1. Added a highly visible style to the ie6.css style sheet only. It puts a border around an element, so I can see it easily if this style is rendered.
2. Cleared caches; turned on Optimize CSS. Everything loads correctly in IE, FF, Safari, Mac, PC, etc. That is, no border around the element when viewed in IE7, but there is a border when viewed in IE6. Perfect.
3. Several days later I'll pull up the site in IE7, and the IE6 border element is rendered.
4. Dump the cache in admin >> performance and the right styles are rendered in IE7 again (for a while).
Any ideas?

#1
Subscribe.
#2
That is so bizarre.
#3
Yes it is -- and the CSS cache files fail on sites hosted on other servers, as well, so it appears not to be an issue of some unique configuration.
I've taken to using the Cleaner module to dump the caches automatically on cron -- kind of a kludgy solution, but it saves me from having the site randomly fail to load properly.
I'd think lots of people would have the CSS cache turned on... wondering why there aren't more posts on this. Is there some simple explanation that I'm missing?
#4
Subscribe. A lot of people still uses IE7. Actually, the majority.
#5
Can you show me what is inside the <head> tag on your site when that happens?
It should look like this:
<!--[if IE]><link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/STARTERKIT/css/ie.css?F" />
<![endif]-->
<!--[if lte IE 6]>
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/themes/zen/STARTERKIT/css/ie6.css?F" />
<![endif]-->
And I don't understand how IE7 would ever start reading the ie6.css stylesheet. Its inside conditional comments.
#6
And, btw, the conditionally included ie*.css stylesheets are not run through Drupal’s CSS optimizer. So the described behavior is even odder.
#7
I'm not sure how I could generate the header under the conditions of the cache failing, other than turning off the Cleaner module and waiting for the site to break again. I'll see if I can think of a way to capture the page source, but I'm not even sure IE or ZEN are at the heart of the problem. That's just the specific case that I was able to reproduce at the time, of the wrong styles being loaded.
Has anyone else experienced the wider issue? That is, not necessarily a specific browser version problem, but the problem of styles not being rendered properly after a while, and the need to dump the performance cache to fix it?