ClientDependency framework not rendering links - Umbraco Cloud, V8
I've got a weird one, been struggling with it all day.
We have a 8.1.5 Umbraco cloud site. A few packages installed but nothing unusual. web.config and clientdependency.config files are straight out of the box.
As we're approaching go-live I tried to configure the client dependency framework to combine and minify some css files:
Page header code looks like this:
@{
// Link in required css files
Html.RequiresCss("~/dist/css/style.css");
Html.RequiresCss("~/assets/fonts/gotham-font.css");
Html.RequiresCssFolder("~/assets/css/live/");
}
@Html.RenderCssHere()
All is well in debug mode. CssHere produces link elements:
But subsequent page requests render this in the html:
<!--[Css:Name="StandardRenderer"]//-->
And obviously the page is unstyled.
Reset the site / touch web.config / bump up the version number of the cdf and it fixes it. - for one request! And then it goes back to this.
This is running in the Development environment on the cloud, toggling between debug mode and not.
Nothing in the error log. Not sure what else to do!
Putting the answer to my own question, for the benefit of future googlers.
The answer is stop looking at the problem and have a weekend off :)
When you return with fresh eyes, you will realise that putting the @Html.RenderCssHere() call within a partial view, which is in turn called with "CachedPartial" may mean that caching gets in the way.
Move the CDF commands up into uncached code - in my case the master page - and it works much better.
ClientDependency framework not rendering links - Umbraco Cloud, V8
I've got a weird one, been struggling with it all day.
We have a 8.1.5 Umbraco cloud site. A few packages installed but nothing unusual. web.config and clientdependency.config files are straight out of the box.
As we're approaching go-live I tried to configure the client dependency framework to combine and minify some css files:
Page header code looks like this:
All is well in debug mode. CssHere produces link elements:
When I switch debug mode off, the first hit to the page works fine, the link looks like this:
But subsequent page requests render this in the html:
And obviously the page is unstyled. Reset the site / touch web.config / bump up the version number of the cdf and it fixes it. - for one request! And then it goes back to this.
This is running in the Development environment on the cloud, toggling between debug mode and not.
Nothing in the error log. Not sure what else to do!
Anyone seen anything similar?
Putting the answer to my own question, for the benefit of future googlers.
The answer is stop looking at the problem and have a weekend off :)
When you return with fresh eyes, you will realise that putting the @Html.RenderCssHere() call within a partial view, which is in turn called with "CachedPartial" may mean that caching gets in the way.
Move the CDF commands up into uncached code - in my case the master page - and it works much better.
is working on a reply...