3

Closed

Cache-busting breaks debugging in VS

description

0.8.1.1 no longer crashes Visual Studio when the debugger tries to break on an error. However, because my js files have the cache-busting version added to the url querystring, it won't break into the ts file. But it will break into the js file. When I remove

require.config({
urlArgs: "version=" + opportunityManagementVersion
});

from my main.ts file, then it will break into the ts source files. But ... as soon as I make changes to my ts files, the browser continues to use the old cached version of the js file. I need to empty the browser cache before the browser, or more specifically
require.js, will load the latest version of the js file. CTRL+F5 in IE does not work. Perhaps for debugging I would remove the cache busting version from the url querystring for the VS debugger to break into the ts source files, if only there was an automatic
way of making sure the browser / require.js loads the latest version of my js files. Note that I will want to add this cache-busting version in the production release of my app, to make sure users always use the latest version of the js files after an upgrade
of my app. I made sure my cache busting version is not some client-side generated timestamp, but is the last modified time of the app assembly on the server.
Closed Jul 28 at 10:18 PM by jonturner
As part of our move to GitHub, we're closing our CodePlex suggestions and asking that people move them to the GitHub issue tracker for further discussion. Some feature requests may already be active on GitHub, so please make sure to look for an existing issue before filing a new one.

You can find our GitHub issue tracker here:
https://github.com/microsoft/typeScript/issues

comments

remco wrote Jun 23, 2013 at 2:33 PM

I reported this issue 6 months ago, and having received only 2 votes, not many people must be having this issue. I should add that I am not required to add a cache-busting querystring to require.js to load my javascript files when developing on Windows 8 using IE10. On Windows 8 when I configure IE10 to check for newer versions of stored pages every time I visit the webpage (under internet options, browser history settings), require.js on IE10 always loads the latest version of the javascript files, and I am therefore not required to add a cache-busting querystring to require.js to load my javascript files, and I can therefore debug my TypeScript files directly.

However, I have been doing most of my TypeScript development in SharePoint 2010 using IE10 on Windows Server 2008 R2. Even when I configure IE10 on Windows Server 2008 R2 to check for newer versions of stored pages every time I visit the webpage (under internet options, browser history settings), require.js on IE10 insists on loading old cached versions of my javascript files. I am therefore required to add this cache-busting querystring to require.js to make sure require.js loads the latest version of my javascript files. But as a consequence I can then no longer debug my TypeScript files and have to debug the javascript files instead.

So, am I doing something wrong? It works with IE10 on Windows 8, but not with IE10 on Windows Server 2008 R2. Or have I not configured IE10 correctly on Windows Server 2008 R2? With only two votes I suppose this issue is not high priority, but I would like to know is it a difficult thing to fix to allow VS to debug the TypeScript when the JavaScript has a cache-busting querystring?

Saqibshakil wrote Sep 29, 2013 at 11:33 AM

I am facing this issue but it is an IE issue rather than typescript as it works fine in chrome. so we should probably report a bug there