We are developing Main WebApp with angularJS as a single page application for the Cordova mobile application.
We moved part of the static resources to a couple of packages that will be served from another WebApp CDN from another domain.
We do not use the helper helper @Scripts.Render @Styles.Render , because the bundles directly reference the built-in static index.html inside a mobile application like this (added via AngularJS):
<script src="https://service.foo.it/CDN/cdnFooJs"></script> <script src="https://service.foo.it/CDN/cdnFooCss"></script>
Since we do not use a razor, we do not add a cache token to src, and this is not what we want; we need a version token to force the client to download an updated version of the package.
I read in a previous post that the v token is computed every time using Scripts.Render.
Now the question is:
Is it possible for programmatic access to the value of this token?
We would like to create a service controller, which, given the route of the bundles, returns the packet SHA256 token.
Once received, it will be used to create script tags that will be added dynamically to the DOM.
<script src="https://service.foo.it/CDN/cdnFooJs?vtoken=asd3...."></script> <script src="https://service.foo.it/CDN/cdnFooCss?vtoken=dasdasrq..."></script>
Note :
We already know that we can create our own token ourselves (for example, using the build number), but it would be nice to have something with less effort and become more attached to the connection mechanism.
source share