Backoffice contributions caching
a
Hi everyone, I have forked the Umbraco repo to do contribution. I use Visual Studio 2022. I run the
Umbraco.Web.UI
project first, the backoffice works, then I made a small change in a .ts file and then run the app again but the second time when I try to open the backoffice it shows me a blank page. I reverted the change, rebuilt the solution but the blank page still occurs. I've followed the steps about white page here: https://docs.umbraco.com/contributing/umbraco-cms/contributing/build#getting-started that say "*If you get a white page, delete \src\Umbraco.Cms.StaticAssets\wwwroot\umbraco folder and run npm ci && npm run build:for:cms inside the src\Umbraco.Web.UI.Client folder to clear out any leftover files from older versions.*" (not sure if these instructions are for the backoffice or the website though), but that does not solve the issue. A simple check in the developer tools shows that there are some files that are missing, print screen attached. I suspect is there some kind of cache maybe? Has anyone encountered anything similar? https://cdn.discordapp.com/attachments/882985025803530332/1422784042767613984/image.png?ex=68e485e5&is=68e33465&hm=2c847d96908670d8c8bdd40793f2111727ecdea0fde0bd76714a869392225620&
j
Every new build gets you a new cache-id (the hash you see in the URLs). You need to refresh with no cache to pick up the files again (CTRL+F5).
a
In my case, the print screen above there's no hash.
I ended up deleting all files and cloned the repo again which fixed the issue. I wish I know what the problem was so can fix it in case it occurs again.
That changes every time you run the server
But the main HTML content is cached by your browser, so it tries to load up a former version of the JS files. When I work on the Backoffice source, I usually check off the "Clear cache" checkbox in DevTools to avoid this problem. Or I work with the Vite dev server (
npm run dev:mock
) which has auto reload and other goodies. There is also
npm run dev:server
which allows you to connect to a running Umbraco instance, but you need to configure the appsettings a bit to allow logins to work from another URL.