Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm currently using cssregistration to add css to sharepoint pages. All is working until I need to do an upgrade of the css. The context is:

I used a delegate control in a feature containing the cssregistration component so that I can activate the feature wherever I want. The problem is when I update my CSS file (located in the LAYOUTS folder) and do an upgrade of the WSP solution, the users don't see the changes. SharePoint is keeping the old version of the CSS (using the old rev number). In fact I need to deactivate/activate the feature to be able to see the changes.
Is it normal? What is exactly the working process of CSSRegistration component?

Thanks for your help.

share|improve this question
    
Do you remember to clear your browser cache everytime? ctrl + F5 (ctrl + alt + E for safari) –  Daniel Ziga Dec 21 '11 at 12:10
    
Yes I did everything for clearing browser cache :( –  Win Dec 21 '11 at 12:54
add comment

1 Answer

up vote 3 down vote accepted

Chris O'Brien wrote a cool post recently about all problems with cached css and javascript files in sharepoint.

UPDATE
If you are using themable css and EnableCssTheming set to true and your site use some theme (using theme is required), sharepoint will compile your css file into another css file with replacing placeholders, that looks like /* [ReplaceColor(themeColor:"Accent6")] */ This css files have ?ctag= querystring parameter (not "?rev="). To make themable css updated, you need to reapply your theme on every update.
More info about themable css you can read here part1 and here part2

If you are not using themable feature (like dynamically replaceable css parameters), you may set EnableCssTheming to false, and you css file will be act as usual.

About updating ghostable in library .thmx file. I am not 100% sure, but I think sharepoint don't touch this file on every http request (but only once when you are applying the theme), this means that you should reapply theme on every update.

share|improve this answer
    
I already read this post, but the thing is in my case the ctrl + F5 or ctrl + R is not working. I think this is more a problem on server side (not client side) in my case. –  Win Dec 21 '11 at 13:18
    
Have you tried Cris's approach? Using described technique you no longer need to do manual refresh –  Kai Dec 21 '11 at 13:27
    
If it can helps, I discovered that my problem is linked to the themable functionality of CSSRegistration component. Since I set the EnableCSSTheming property of the control to false and moved my css file outside the themable folder, my css files started to be refreshed normally after wsp upgrades. If anyone knows anything about this behavior... –  Win Dec 21 '11 at 14:08
    
If you are using themable css and EnableCssTheming set to true and your site use some theme (using theme is required), sharepoint will compile your css file into another css file with replacing placeholders, that looks like '/* [ReplaceColor(themeColor:"Accent6")] */' This css files have ?ctag= querystring parameter (not "?rev="). To make themable css updated, you need to reapply your theme on every update. –  Kai Dec 21 '11 at 14:11
    
More info about themable css you can read here part1 and here part2 –  Kai Dec 21 '11 at 14:12
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.