Tutorial :Autoversioning externally linked content



Question:

So I'm building a javascript library meant to be loaded by external domains. I'm looking for a good way to do auto-versioning for this. Ideally, the external domain should be able to just write <script src="<filename>" type="text/javascript"></script> and somehow have that version correctly.

The best solution I can think of is to have the <filename> point to a page, built using a server-side language, that dynamically includes the right javascript libraries with the right versioning. The problem with this is that it requires the javascript to be dynamically loaded and means that our server will be hit on every load (ie it can't be cached).

Any ideas?


Solution:1

Refer to this link.

http://blog.sallarp.com/asp-net-automatic-css-javascript-versioning/

This tells us about creating custom control for script tag, link tags(css) and then emits the static contents using the dummy querystring saying ?version=1.2.3


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »