Copied to clipboard

Flag this post as spam?

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


  • Niclas Schumacher 67 posts 87 karma points
    Dec 18, 2013 @ 13:33
    Niclas Schumacher
    0

    umbraco dosn't load new version of js file.

    im following the http://umbraco.github.io/Belle/#/tutorials/CreatingAPropertyEditor tutorial, just to get a hang of how umbraco 7 is doing things. 
    Though, i can make it to take the new version of my js file with it, no matter what i do. Ive re-build, restarted the application deleted app_data/TEMP, but it still give me the alert from the first version instead of taking the new version of the js file. 
    Anyone els have a problem with this ? and how to avoid it ?

  • Niclas Schumacher 67 posts 87 karma points
    Dec 18, 2013 @ 14:47
    Niclas Schumacher
    0

    What should i do to umbraco to know about the new version of the javascript file ? can't figure out what does it, but sometimes the new version get loaded, though it is a combination of clearing browser cache, clearing app pool, reseting the site, deleting temp folder.. Should it really be that hard?!

  • David Zweben 265 posts 749 karma points
    Dec 19, 2013 @ 04:05
    David Zweben
    0

    I had the same problem. I don't have a good solution, but the workaround I found was to increment a number at the end of the controller's filename (e.g. "myPropEditor005.controller.js"), and update the link in the manifest accordingly ( "~/App_Plugins/MyPropEditor/MyPropEditor005.controller.js"), each time I want to test it. It's a pain, but it did at least work reliably as long as the filename was unique each time. When doing this, I usually didn't even have to clear the cache or touch web.config, refreshing the page was usually enough.

    Hopefully there is, or will soon be, a better way to do this.

  • Per Ploug 865 posts 3491 karma points MVP admin
    Dec 19, 2013 @ 10:00
    Per Ploug
    0

    There are currently 2 caching mechanisms in umbraco 7 - on the client-side the browser caches files quite heavily, and the angularjs framework we use, also does quite a bit - normally clearing the browser cache will work there.

    Additionally, there's the client dependency framework on the serverside, which combines and minifies js+css files, this is turned off when the site is in debug mode, which it should be during development.

    We've logged acouple of issues on file caching and will work on imroving this in 7.0.2

    /Per

  • Comment author was deleted

    Jan 07, 2014 @ 20:01

    To be a bit more specific, go to your web.config and change the debug attribute to true.

     

    <compilationdefaultLanguage="c#"debug="true"batch="false"targetFramework="4.5">

    This disables the minification/cache for js files as Per described.

    This got me at first too.

  • Cristovao 12 posts 33 karma points
    Jul 14, 2016 @ 09:38
    Cristovao
    1

    Other option without changing debug=true (in my opinion you should not change this on a deployed site) is handling the client dependency api. Edit the ClientDependency.config file under Config folder.

       <clientDependency version="1816063017" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.UI.CdfLogger, umbraco">
    

    Increase the version value and save the file (on this case will be 1816063018 ). All your .js files and .css files with be refreshed with your changes.

    Hope this helps, I spend some time to figured out this cache system.

  • Ian Grainger 71 posts 135 karma points
    Feb 08, 2018 @ 09:34
    Ian Grainger
    0

    Updating the version number actually didn't seem to work for us. I think that's because debug is enabled on our test site.

  • Johan 2 posts 71 karma points
    Apr 12, 2017 @ 11:39
    Johan
    0

    A bit late but I solved it by adding a query parameter to the script tag src attribute and change it every time I update the js file.

    <script src=yourjsfile.js?v=2></script>

  • Oriol 5 posts 77 karma points
    Jul 23, 2018 @ 09:45
    Oriol
    0

    There are other answers, but I'm not a fan of debug=true solution which is the only one here that worked for me. Besides, if you remove it back the debug attribute it goes back to previous js version.

    What worked for me was to remove folders:

    App_Data\cache
    App_Data\TEMP
    

    This forced Umbraco to recompile the js files.

    Note: It pops an error that some indexing files are not able to be removed, just skip those.

Please Sign in or register to post replies

Write your reply to:

Draft