DotNetNuke, ASP.NET, Web Development Blog

Updating CSS with Client Resource Management enabled and without having to "Clear Cache" constantly

I really like the idea of the Client Resource Management features added to DotNetNuke in version 6. But, it can make building a new skin or a new site on a live instance of DNN rather painful as any changes you make to the .CSS or .JS files won't be seen unless you clear the site's cache or put the site into DEBUG mode.

In theory, all skin development should probably happen on a development instance and the live site should only be updated once the skin updates are complete. But, in practice, we find lots of cases where we do need to be able to make CSS updates to a live instance (though not necessarily a live site) of DNN.

You can do this by updating the .css file and then clicking "Clear Cache" in the control panel. But, every time you do that, a new version of the combined files is created and users will need to download the file again. So, it's best to avoid that.

What I've found works better is to create a <style></style> section within your skin and for any changes you want to make, make those changes within that style section. Once you've got all your changes done, migrate them into the .css file and delete the <style></style> section from the skin, and clear the cache. That method allows us to quickly and painlessly make changes.

Also, for experimenting with minor updates, Firebug is a great tool as you can see what your changes will look like and then apply them when you're happy with them.

Happy coding!


Leave a Comment
Email: (not displayed)

Enter the code shown above:

Return to previous page