CSS Doesnt appear to Load on first attempt

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
3/3/2010 5:41:55 AM
Gravatar
Total Posts 37

CSS Doesnt appear to Load on first attempt

Hi guys,

I have a strange problem occurring with my skin. Ive created a custom skin to work with Mojo (nothing fancy) and when i load my site into my browser on first load the css doesnt appear to have loaded. If i hit F5 on my keyboard the page reloads and my skins appears as expected.

This only happens in IE6. In newer browsers i dont have the issue.

What i dont udnerstand is why after hitting F5 the skin displays correctly but on first load its as is there is no CSS.

I have updated IESpecifc.css which is confirmed after hitting F5. Could the problem be that Mojoportal is not loading my IE6 stylesheet in time before the page loads?

ps. Sadly, at the moment, 80% of the site users are still on IE6.

Thanks

Adrian

3/3/2010 6:24:38 AM
Gravatar
Total Posts 70

Re: CSS Doesnt appear to Load on first attempt

Hi,

I've seen this issue before. What I found is this problem occurs in IE 6 if you have:

<add key="CacheCssOnServer" value="false" />

and

<add key="CacheCssInBrowser" value="false" />

if you set those to true it should solve the problem. You only want those to be false when you are working on the design, as soon as you finish the design you should set them to true.

Hope that helps,

Steve

3/3/2010 7:22:33 AM
Gravatar
Total Posts 37

Re: CSS Doesnt appear to Load on first attempt

Hi Steve, thanks for the reply.

I did change those settings to true but the problem persists. That site is on version 2.3.3.0 at the moment and im aiming to update it later today. But im not sure if that would make a difference.

Any other ideas?

Adrian

3/3/2010 7:26:10 AM
Gravatar
Total Posts 18439

Re: CSS Doesnt appear to Load on first attempt

After making those changes you may need to clear the browser cache one time. Also make sure you have:

<add key="CombineCSS" value="true"/>
<add key="MinifyCSS" value="true"/>

Hope it helps,

Joe

3/3/2010 7:54:21 AM
Gravatar
Total Posts 37

Re: CSS Doesnt appear to Load on first attempt

Hey Jo,

Thanks for the speedy reply. Those values are also set as you suggested. Ive not changed those from the defaults. Ive also cleared out the browser cache and set it to check for newer versions on every visit to the page (within IE6). Unfortunately the problem persists.

Its really odd, if i hit F5 on the home page it loads correctly but if i navigate to one of the other pages problem comes back.

Ive tried it on 4 different PC's running IE6 and its the same issue. Could it be a timing issue do you think?

Adrian

3/3/2010 8:00:46 AM
Gravatar
Total Posts 18439

Re: CSS Doesnt appear to Load on first attempt

Does it happen with every skin or only specific skins? Possibly it is a css issue in a specific skin.

3/3/2010 8:11:05 AM
Gravatar
Total Posts 37

Re: CSS Doesnt appear to Load on first attempt

Hey Jo,

Ill update one of the other skins for IE6 and give it a go. What confuses me is why does it load correctly after hitting F5? That would suggest the CSS is ok wouldnt it?

Adrian

3/3/2010 8:37:07 AM
Gravatar
Total Posts 18439

Re: CSS Doesnt appear to Load on first attempt

Well, IE 6 has enough quirks and bugs that I think it could be possible some combination of css leads to this issue. It may be difficult to figure out what in the css is causing it though. One strategy would be to backup your skin and then start chopping things out of the css and see if you get to a point where the problem does not happen, than gradually put stuff back and figure out what specific css is causing it.

Hope it helps,

Joe

3/3/2010 8:58:35 AM
Gravatar
Total Posts 37

Re: CSS Doesnt appear to Load on first attempt

Yeah, it must be done :)

Thanks again for hte tips and advice Joe and Steve. Much appreciated. I will post back with my findings in case this might help others.

Adrian

3/5/2010 5:18:30 AM
Gravatar
Total Posts 37

Re: CSS Doesnt appear to Load on first attempt

Joe / Steve,

I think i have resolved the issue. In my situation, the CSS remained unchanged and i made the following changes to web.config.
<add key="CombineCSS" value="false" />
<add key="MinifyCSS" value="false" />
<add key="CacheCssOnServer" value="true" />
<add key="CacheCssInBrowser" value="true" />

Joe, your post below got me thinking about the CombineCSS and MinifyCss options. These are set to true by default, however changing them to false has resolved my issue with IE6. I can also see no problems in IE8, FF, Opera or Chrome.

Not sure why this has resolved the issue but ill look into that and post back my findings.

Thanks again for all the help.

Adrian
 

You must sign in to post in the forums. This thread is closed to new posts.