Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • chris cameron 36 posts 56 karma points
    Apr 14, 2012 @ 07:10
    chris cameron
    0

    CSS changes not coming through to front end

    I am making CSS changes via the Umbraco backend however when I refresh the front end website the changed CSS is not being pulled through. I have checked permissions on the CSS dir and they are all ok with full modify rights. I have deleted the styles.css file completely and the front end still showed with css??? I then recreated the styles.css file and front end still showed old css. I checked the file in the CSS di and this one is as I have changed it.

    When I make a template change however that does affect the css ie, change the linked css filename, this does have an effect.

    browser CTRL+F5 numerous times with now affect.

    I have republished the entire umbraco site 3 times and no change. It still is using old css that no longer exists as far as I can see.

    I am at my wits end on why the front end is not displaying the css I can see in the back end. Any ideas?

    umbraco 4.7.1.1 on Windows XP with Chrome browser

  • Peter Nielsen 159 posts 257 karma points
    Apr 14, 2012 @ 09:46
    Peter Nielsen
    0

    I have tried that once, and it was a server caching issue, and not Umbraco.

    My solution was to make a randomizing XSLT, which gave me a random number, and then set it after the css link in the header.

    Like this:

    <link rel="stylesheet" href="main.css?<umbraco:Macro Alias="RandomNumber" runat="server" />" type="text/css" />

     

    So it became like this:

    <link rel="stylesheet" href="main.css?38743237" type="text/css" />

     

    Then it sees the stylesheet as a new file everytime :-)

    /Peter

     

  • chris cameron 36 posts 56 karma points
    Apr 26, 2012 @ 22:59
    chris cameron
    0

    Am I right though that Umbraco shouldn't be doing this? I shouldn't need a random number 

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 26, 2012 @ 23:34
    Jan Skovgaard
    0

    Hi Chris

    Are there any particular reason why you're editing the CSS using the backoffice instead of editing the CSS file in an editor?

    However I think the issue you experience is because Umbraco (in v4) seems to be caching pretty hard. Therefore you should try to clear all the browser cache. I don't think ctrl+f5 is enough in this case since when editing the stylesheet from within Umbraco saves it in the database instead of on disk (If I remember correctly).

    As Peter mentions above adding a random number as a querystring makes sure you avoid caching issues.

    In general you should always edit css files outside of Umbraco when possible.

    Hope this helps.

    /Jan

  • Theo Xavier 8 posts 25 karma points
    Jun 10, 2012 @ 06:02
    Theo Xavier
    0

    I am currently having the same issue regardless of whether I edit the css file inside or outside of umbraco.

Please Sign in or register to post replies

Write your reply to:

Draft