Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
We are integrating Azure CDN with Umbraco. CDN is integrated and we have written helper method to make a CDN external call. However, we need to include cache-busting technique too.
This was possible in Umbraco v7 using below package.
How can we do it using v8? Looking forward for your views.
Could you possible try something simple like for example.
Store a cache busting number within your web config. Call it something like ImageCacheVersion.
Then when you are referencing the image urls just add a query string on the end of the url.
That way when you change the value in the web config then the URL is going to be different and so shouldn't be returned from the Cache.
A simple idea but it will be checking that a query string is allowed by Azure CDN. My guess is it will be fine.
Where in the web.config would you put this and what would the xml look like? This could be interesting to easily version up js / css as well, just not sure exactly how to implement it.
Here is an example of the web.config.
This should get added into the appSettings section.
As you can see I have added a cache busting property at the bottom.
<add key="Umbraco.Core.DefaultUILanguage" value="en-US" />
<add key="Umbraco.Core.UseHttps" value="false" />
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
<add key="ClientValidationEnabled" value="true" />
<add key="webpages:Enabled" value="false" />
<add key="enableSimpleMembership" value="false" />
<add key="autoFormsAuthentication" value="false" />
<add key="dataAnnotations:dataTypeAttribute:disableRegEx" value="false" />
<!--<add key="owin:appStartup" value="UmbracoDefaultOwinStartup" />-->
<add key="owin:appStartup" value="UmbracoStandardOwinStartup" />
<add key="Umbraco.ModelsBuilder.Enable" value="true" />
<add key="Umbraco.ModelsBuilder.ModelsMode" value="Nothing" />
<add key="Umbraco.ModelsBuilder.EnableApi" value="true" />
<add key="CacheBuster" value="1000" /><!-- version number -->
And here is code to be able to read from the web.config.
More info can be found here.
If you pop the a query string on the end of the image I think that should work.
So the image might look something like.
And the version 1000 will be read from your new web.config setting. When you want to get a fresh image without using the cache then increase the version number in your web.config to 1001, 1002, 1003 and so on.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted