Copied to clipboard

Flag this post as spam?

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


  • ThomasBrunbjerg 90 posts 182 karma points
    Oct 02, 2017 @ 06:46
    ThomasBrunbjerg
    1

    Clearing cache correctly, updating changes

    To be honest, I've no idea how Umbraco handles clearing its cache. I'm currently developing a property editor, and I'd like to see the result of my changes in the content section. However whenever i save my changes, build the project and refresh the page, nothing has changed.

    I've tried deleting the cache folder, changing the web.config file, installing a special chrome extension to do a hard reset, clearing the entire cache, closing and opening Visual Studio and nothing seems to make any difference.

    How can I make Umbraco update its cache to reflect the changes I've made to a property editor in the content section?

  • Alex Skrypnyk 6168 posts 24148 karma points MVP 8x admin c-trib
    Oct 02, 2017 @ 07:26
    Alex Skrypnyk
    1

    Hi Thomas

    Umbraco uses ClientDependency for client caching in the backend, ClientDependency stores cached files on the disk, that's why restarting doesn't help, try to change clientDependency code version in /config/ClientDependency.config like on the screen:

    enter image description here

    Or just use this package for changing version of client dependency cache - https://our.umbraco.org/projects/developer-tools/health-check-for-client-dependency-framework/

    Thanks,

    Alex

  • ThomasBrunbjerg 90 posts 182 karma points
    Oct 02, 2017 @ 08:27
    ThomasBrunbjerg
    0

    Thanks Alex. I changed the number of the client dependency to the one you provided, but my changes to the controller of my property editor are still not being reflected in the backoffice. I've tested it with a few console.logs, but they aren't being displayed.

    Am I doing something wrong by saving and building my project each time I make a change in the controller?

  • Alex Skrypnyk 6168 posts 24148 karma points MVP 8x admin c-trib
    Oct 02, 2017 @ 08:48
    Alex Skrypnyk
    0

    Thomas, you don't need to build project each tine if you just change .js file

    But you need to change version of ClientDependency cache

  • Alex Skrypnyk 6168 posts 24148 karma points MVP 8x admin c-trib
    Oct 02, 2017 @ 08:48
    Alex Skrypnyk
    0

    Also, check please, are you running the project in Debug mode?

  • ThomasBrunbjerg 90 posts 182 karma points
    Oct 02, 2017 @ 08:57
    ThomasBrunbjerg
    0

    Ah, that might be it. I think I was running the project in release mode, as I am using CTRL+F5 to launch it.

  • Alex Skrypnyk 6168 posts 24148 karma points MVP 8x admin c-trib
    Oct 02, 2017 @ 08:58
    Alex Skrypnyk
    100

    Always run in Debug mode while you are working on it.

  • Alex Skrypnyk 6168 posts 24148 karma points MVP 8x admin c-trib
    Oct 04, 2017 @ 08:58
    Alex Skrypnyk
    0

    Hi Thomas

    Did you solve the issue?

    Thanks,

    Alex

  • ThomasBrunbjerg 90 posts 182 karma points
    Oct 04, 2017 @ 09:03
    ThomasBrunbjerg
    0

    Hi Alex

    Yes, i managed to solve it by running the program in debug mode. Now my changes are reflected when i save.

    Thanks again.

  • Alex Skrypnyk 6168 posts 24148 karma points MVP 8x admin c-trib
    Oct 04, 2017 @ 09:03
    Alex Skrypnyk
    0

    Glad that it's solved, have a great day!

  • Nick 34 posts 127 karma points
    Oct 02, 2017 @ 08:47
    Nick
    0

    Hey Thomas

    Have you tried adding a query string to the end of the URL? Inside the plugin package.manifest your can add a random query string at end of the urls so the browser needs to re cache that url

    eg. "~/App_Plugins/Javascript Url" + "?v=123432asdsa"

  • ThomasBrunbjerg 90 posts 182 karma points
    Oct 02, 2017 @ 08:55
    ThomasBrunbjerg
    0

    Hi Nick, thanks for your answer. Where do I add the random query string in my package.manifest?

    This is my package.manifest file:

    {
        propertyEditors: [
         {
            alias: "My.Media.Crop",
            name: "MediaCrop",
            editor: {                                           
            view: "~/App_Plugins/MediaCrop/mediacrop.html",
            hideLabel:true,
            },
            prevalues: {
        fields: [
            {
                label: "Media Picker Property Alias",
                description: "The alias of the Single Media Picker that you want to be able to edit crops for the picked item for",
                key: "pickerAlias",
                view: "textstring"
            },
            {
                label: "File Property Alias",
                description: "eg. umbracoFile (defaults to this if this is empty)",
                key: "filePropertyAlias",
                view: "textstring"
            }, {
                        label: "Hide Label",
                        description: 'Hides the property label & description when selected',
                        key: "hideLabel",
                        view: "boolean"
                    }
        ]
    }
        }],
       javascript: [
       '~/App_Plugins/MediaCrop/mediacrop.controller.js',
       ],
        css: ['~/App_Plugins/MediaCrop/mediacrop.css']
    }
    
  • Alex Skrypnyk 6168 posts 24148 karma points MVP 8x admin c-trib
    Nov 03, 2017 @ 14:54
    Alex Skrypnyk
    0

    Hi Thomas

    Nik wanted to say to add query param files like that:

    javascript: [
       '~/App_Plugins/MediaCrop/mediacrop.controller.js' + '?v=123432asdsa',
       ],
        css: ['~/App_Plugins/MediaCrop/mediacrop.css'+ '?v=123432asdsa'
    ]
    }
    

    But I think it's better to render clientDependency again, it's better to work with files like it will be on the live environment,

    Thanks,

    Alex

  • Carlos Casalicchio 176 posts 736 karma points
    Sep 04, 2019 @ 14:58
    Carlos Casalicchio
    0

    Deleting the \App_Data\TEMP\ClientDependency folder also does the trick

    refer to Changes in Plugins' js file not applied due to cache

Please Sign in or register to post replies

Write your reply to:

Draft