More in this section
Forums / Designing & Styling / Built-in CSS versioning

Built-in CSS versioning

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
4 posts, 0 answered
  1. mdub
    mdub avatar
    12 posts
    22 Aug 2012
    04 Apr 2014
    Link to this post

    I have not seen any documentation on this, so I thought I should post information about the built-in CSS version query string in Sitefinity.

    By default, when you add a css file to your theme, Sitefinity will add a query string with the version number such as style.css?v=60743210. This is very helpful for making sure that when you push updates your users immediately get your updated styles.

    There is one important thing to know in order to get this to work. As far as I can tell, your theme must be in the ~/App_Data/Sitefinity/WebsiteTemplates/[YourFolder]/App_Themes/[YourTheme]/ folder, otherwise the query string will not be added. It does not work if your theme is in ~/App_Themes/[YourTheme]/

  2. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    17 Aug 2017
    08 Apr 2014
    Link to this post
    Hi Michael,

    Thank you for sharing this information with the community.

    Sabrie Nedzhip
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
  3. Jacques
    Jacques avatar
    427 posts
    28 Jun 2007
    03 May 2016 in reply to mdub
    Link to this post

    Do we know what causes the version number to change? What triggers a new version number? 

    Also, I've noticed that CSS files in the ~/App_Data/Sitefinity/WebsiteTemplates/[YourFolder]/App_Themes/[YourTheme]/Global folder do get the version number, but if you have files in deeper folders like ~/App_Data/Sitefinity/WebsiteTemplates/[YourFolder]/App_Themes/[YourTheme]/Frameworks/Telerik it doesn't get a version number. 

    So the question is really, what are the exact rules around this versioning feature? 

  4. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    13 Aug 2007
    06 May 2016 in reply to Jacques
    Link to this post

    Hey Jacques,

    As also posted on SO (but just for completion here) the behavior is part of the ThemeController class inside Telerik.Sitefinity.dll and essentially checks for the file last write time-stamp  to include the cache busting version number.

    string str = string.Concat(VirtualPathUtility.AppendTrailingSlash(theme.Path), "global/", fileInfo.Name);

    The /global/ part of the folder structure is hard-coded so you'll have to work around it if you'd like to make it work for other folders.

4 posts, 0 answered