0
votes

I'm using the following code these days to include my JS and CSS files within my (Umbraco) websites:

@using ClientDependency.Core.Mvc;

@{
    Html.RequiresCss("link-to-file", 1);
    Html.RequiresCss("link-to-file", 2);
    Html.RequiresJs("link-to-file", 1);
}

I've noticed that the following files is being called when loading the site: https://mysite.nl/DependencyHandler.axd?s=L2xpYi9zY3JpcHRzL21vZGVybml6ci5jdXN0b20uanM7L2xpYi9zY3JpcHRzL2pxdWVyeS5kbG1lbnUuanM7L2xpYi9zY3JpcHRzL3NpdGUuanM7&t=Javascript&cdv=1511701721

After making changes to either the CSS or JS files and uploading them to the server, the DependencyHandler call remains the same. Therefor, the CSS and JS are being cached on the server and I don't see my changes on the live site.

I need to manualy change the ClientDependency version (within ClientDepenedency.config). If I change that, the 'cdv' value at the end of the DependencyHandler call is changed (to the version I changed it in ofcourse), and the new files are being served.

Is there a way to get the DependencyHandler notice changes in the files and automaticly refresh the cache?

1
github.com/Shazwazza/ClientDependency/wiki/Versioning according to this if you go to the cdf config and do <clientDependency version="yourVersionNumberhere" /> that will bust the cache on your next deployment. So, I guess, by default, no, but you can write something that raises the version every time you deploy. - Jabberwocky
Maybe a script that increases that number during build in visualstudio. But I was hoping there was an automatic way. - Cryothic
Maybe but it doesn't look like it to be honest. Just write something to increase that specific config's value every time. Can't you do that? - Jabberwocky
I'll give it a go. Thanks - Cryothic

1 Answers

0
votes

If anyone is still ask this question, as a response, you can enter

Shift+F5

on search engine.

Maybe, it is a response this question. By the way if you were doing <compilation defaultLanguage="c#" debug="true" ...> in Web.config, you can look js or css files.

If this problem isn't cache problem, should been controled server connection, services,.. Except that, if it is a OOP's problem, wouldn't umbraco throw a mistake? As I said, I understood this text as a cache problem and I response as it. Hope it work.