I'm using Drupal 5.1

I've been playing with Drupal on and off for about two years, so I have a rough idea what I'm doing. However, I have an issue with my site when I try to set the "Aggregate and compress CSS files:" option under the Performance section of the administrator control panel.

First off, I feel like my site really needs an option like this, because I have several modules installed, and about five of these modules have their own CSS file. Because the user has to download so many CSS files, my site can take a pretty long time to load. I'm loading that the "Aggregate and compress CSS files:" option can fix this issue.

However, what happens when I try getting the "Aggregate and compress CSS files:" option is it doesn't work. What I mean is it doesn't load any CSS file AT ALL. So, my site loads, but without loading any CSS file. It looks pretty horrible.

When I look at the source code, I see that it's trying to load this CSS file:

@import "/files/css/2eee25d915c4595b5fe16a3a2dae54f1.css";

Please help. I really want to get compression of CSS files to work and get it to actually cache and load my CSS files correctly. I don't remember this option being in previous versions of Drupal, so that's why I'm not exactly sure how to use it or what I'm doing wrong.

Comments

catch’s picture

/files/css/2eee25d915c4595b5fe16a3a2dae54f1.css

looks about right.

Have you tried that url (or looked via ftp/scp/file manager in cpanel) to see if it actually shows up?

Have you switched it off and on again?

Done a hard refresh in your browser?

enthusaroo’s picture

Hey catch,

Thanks for your reply...

/files/css/2eee25d915c4595b5fe16a3a2dae54f1.css
looks about right.

I have eight of these CSS files with long names now in my file/CSS directory. So, the file(s) are definitely there. For some reason, Drupal just can't read or process them. Or perhaps the CSS caches were not generated properly? Just a guess. Maybe there is an issue with permissions? Currently it's set to 755 permissions. The strange thing is that I'm unable to change the permissions on this directory or the files within, and this is the first time that has happened on this Drupal installation.

Have you switched it off and on again?

I have switched it on and off, on and off, on and off, and so on. Every time it still has the same issue with not being able to load the CSS.

Done a hard refresh in your browser?

Actually, now I have some more information regarding this issue. The issue seems to be specifically affecting Firefox. I did a "hard refresh" of Firefox and deleted all temporary files, but I still get the issue. I try the same pages in IE, but it seems to load ok. I try the same pages in Opera and at first it can't load the CSS file, but then after the page 100% finishes loading, it somehow manages to correct the page by itself.

So, in IE it seems to work. In Firefox, it can't load the CSS at all with "compress CSS" option set to on. And in Opera it can't load the CSS, but then apparently it seems to correct itself somehow.

I'm not sure what to do next to get this to work. :(

catch’s picture

Hmm I don't think you should have six, unless they just build up cumulatively and never get deleted, which I'd class as a bug.

If the /files folder is owned by your webserver user (normally www-data), then that will be fine for it to be 755, and probably also the reason why you can't change the permissions in ftp. I'm assuming you don't have root access to the server? If not you might have to ask your hosting company to clear those files, or change ownership to your account (in which case you may need different permissions on the folder as well).

If it was me, I'd disable caching, delete those files, re-enable it and try to eliminate some variables (like browser etc.) - also look in your stats for 404 not found or 403 denied aerrors. PLus check the filename in view source actually matches the file in the folder.

Have you tried browsershots or a different machine as well?

catch’s picture

Hmm I don't think you should have six, unless they just build up cumulatively and never get deleted, which I'd class as a bug.

If the /files folder is owned by your webserver user (normally www-data), then that will be fine for it to be 755, and probably also the reason why you can't change the permissions in ftp. I'm assuming you don't have root access to the server? If not you might have to ask your hosting company to clear those files, or change ownership to your account (in which case you may need different permissions on the folder as well).

If it was me, I'd disable caching, delete those files, re-enable it and try to eliminate some variables (like browser etc.) - also look in your stats for 404 not found or 403 denied aerrors. PLus check the filename in view source actually matches the file in the folder.

Have you tried browsershots or a different machine as well?

catch’s picture

Hmm I don't think you should have six, unless they just build up cumulatively and never get deleted, which I'd class as a bug.

If the /files folder is owned by your webserver user (normally www-data), then that will be fine for it to be 755, and probably also the reason why you can't change the permissions in ftp. I'm assuming you don't have root access to the server? If not you might have to ask your hosting company to clear those files, or change ownership to your account (in which case you may need different permissions on the folder as well).

If it was me, I'd disable caching, delete those files, re-enable it and try to eliminate some variables (like browser etc.) - also look in your stats for 404 not found or 403 denied aerrors. PLus check the filename in view source actually matches the file in the folder.

Have you tried browsershots or a different machine as well?

enthusaroo’s picture

Hey catch,

Thanks for your reply...

/files/css/2eee25d915c4595b5fe16a3a2dae54f1.css
looks about right.

I have eight of these CSS files with long names now in my file/CSS directory. So, the file(s) are definitely there. For some reason, Drupal just can't read or process them. Or perhaps the CSS caches were not generated properly? Just a guess. Maybe there is an issue with permissions? Currently it's set to 755 permissions. The strange thing is that I'm unable to change the permissions on this directory or the files within, and this is the first time that has happened on this Drupal installation.

Have you switched it off and on again?

I have switched it on and off, on and off, on and off, and so on. Every time it still has the same issue with not being able to load the CSS.

Done a hard refresh in your browser?

Actually, now I have some more information regarding this issue. The issue seems to be specifically affecting Firefox. I did a "hard refresh" of Firefox and deleted all temporary files, but I still get the issue. I try the same pages in IE, but it seems to load ok. I try the same pages in Opera and at first it can't load the CSS file, but then after the page 100% finishes loading, it somehow manages to correct the page by itself.

So, in IE it seems to work. In Firefox, it can't load the CSS at all with "compress CSS" option set to on. And in Opera it can't load the CSS, but then apparently it seems to correct itself somehow.

I'm not sure what to do next to get this to work. :(

enthusaroo’s picture

I downloaded ca91bec5062770db84543a2cc1c14643.css today and found that it's EMPTY. This is obviously the cause of this issue. Why would it be creating an empty CSS file? How can I fix it?

enthusaroo’s picture

WOW.

I just found out what the issue is causing this. Looks like the UIEforum module is causing it. I just tried disabling the UIEforum module and now CSS caching works like it should. I guess I need to file an issue now with that module..

Sharing Is Caring! Share your Love Across Borders

xjessie007’s picture

Hi,

I am not sure if I am posting my question at the right place, so sorry if it does not belong here, it is related to this module though. I would like to turn the Aggregate and compress css files feature on in my installation, but it is disabled by default. I can't check the Enabled radio button because it is grayed out with the Disabled checked. Would anyone know why it is so in my case?

Thanks much.

---------
www.Maxi-Pedia.com Maxi-Pedia: Your resource for finance and IT!
www.Maxi-Pedia.com/forum Maxi-Pedia Forum: Your place to discuss finance and IT!
www.finance-management.cz Central European Center for Finance and Management

xjessie007’s picture

Ooops, I found the answer.

Download method is set to private

Just on the side for those following in my foot steps :) -- It looks like changing the download method from private to public can become a major hassle, see this post: http://drupal.org/node/319334
(just posting it here for complete documentation purpose)

---------
www.Maxi-Pedia.com Maxi-Pedia: Your resource for finance and IT!
www.Maxi-Pedia.com/forum Maxi-Pedia Forum: Your place to discuss finance and IT!
www.finance-management.cz Central European Center for Finance and Management

jimkeller’s picture

I was having an issue with blank CSS files myself, and after some digging, I found that it was because my /tmp partition was full. Drupal's file_save_data() method uses temp files when writing (probably to avoid race conditions), and it couldn't write the temp file, so my CSS files in sites/default/files/css were showing up as blank, and causing my page to have no style.

frankcarey’s picture

thanks jimkeller. This hit us too. Nothing shows in the error logs :(

Note that 20 bytes was displayed for the file in firebug->Net and was not a 404 (because it existed, but empty). not sure if it was a 20 byte file of if that was just the headers.

Frank Carey