3

I am on c# .net core 2.2 webapp I am using [asp-append-version="true"] in cshtml for js and css for cache-bursting. But the issue is i am adding a script like

    <script src="~/js/Video/Video.js" type="module" asp-append-version="true"></script>

The video.js file has following code basically it has some imports

import { TestCongestionHeaderInfo } from '../TestCongestionHeaderInfo.js';
import { ResponseHandler } from '../Common/ResponseHandler.js';
...

I do get versioning for video.js but not for the imported module files. Following is the screentshot from chrome Network inspect window

enter image description here

How can i achieve versioning for the imported files also?

Jignesh
  • 125
  • 8
  • Well, basically you need to add asp-append-version also for the imported files. I assume that you add them with script tag to your site too, don't you? – Stanislav Balia Oct 21 '20 at 15:07
  • @StanislavBalia, doing so adds two file on ui side for e.g as in the above problem statement i am using vide.js in cshtml as per your suggestion if i am adding TestCongestionHeaderInfo.js and ResponseHandler.js in cshtml as a script with asp-append-version i am gettin two files for each on ui side Like 1. **TestCongestionHeaderInfo.js** and **TestCongestionHeaderInfo.js?v=70Q539HoF(version)** 2. **ResponseHandler.js** and **ResponseHandler.js?v=70Q539HoF(version)** this should not ideally be the case – Jignesh Oct 22 '20 at 04:33

0 Answers0