2
lb13
7y

Does anyone else notice a delay between updating the CSS for a page and it actually taking effect?

Comments
  • 2
    Nope. Check caches
  • 1
    Aren't you referring to browser cache? Clear cache and css (and js) will be re-downloaded from server.
  • 1
    Thanks, that helps, although in this case I think I had conflicting styles, which is why it wasn't showing how I expected!
  • 2
    A trick i use when developing a new site is to have a random number generated at the end of the style sheet url, that way it'll load fresh every time, obviously remove once out of development.
    /css/style.css?<?php echo rand(); ?>
  • 1
    Actually I don't see that as a trick... I use it with AngularJS web app development. I use grunt to minify and uglify is and add an hash of the file to it's name and dinamically point the references to it with a bundle.

    This way I don't have stale cache in the clients browsers on a Sprint deploy...

    Never seen it be used with css but you can do the same with less or sass.

    Another way is to set a cache refresh header after a deploy but that never works 100% of the cases.

    For Dev environment just clear the browser cache.

    For you problem in particular use some form of syntax checking. While your at it try less and node to compile it, you will discover a beautiful new world ;)
Add Comment