Visual Studio 2017 Debugging - Disable Browser Cache
Asked Answered
W

2

16

I use Visual Studio 2017 for web development pretty heavily, and when you let it open a browser (Chrome is my preference, though this would apply to Edge) it often loads cached versions of scripts and CSS. I know I can go to the Network tab and choose Disable Cache, but is there a way to get VS to just always load the browser with that option selected?

Weigle answered 28/3, 2018 at 17:55 Comment(2)
for chrome : resolved in https://mcmap.net/q/751522/-disable-browser-caching-for-css-and-js-file-during-development/52275910#52275910Tymbal
I was already using the hard refresh option - this was more of a Visual Studio question, because every time Chrome launches in debug, it starts a new session (which isn't tied to my normal Chrome instance, doesn't have me logged in, etc.) and the cache was always re-enabled. I was hoping there was a way to tell VS to stop doing that :-)Weigle
D
7

You can point cache dir to null using startup arguments for chrome.
This will disable any caching.

First manage browsers

browser select

Then add new Chrome browser with attribute: --disk-cache-dir=null

add chrome with argument

Dormitory answered 20/12, 2019 at 11:58 Comment(4)
This is what I was looking for. ThanksAppropriation
For some reason, it doesn't work for me :(Flytrap
It wasn't working for me at first, but after I close all my visual studio and chrome, it worked! Thanks... :)Flytrap
WOW! I wish I could do that, but I am running Visual Studio 2022 and cannot see how to add it - I just select Google Chrome - but can see no way to edit it. The Add button is not in this version. I found out how to add it. I clicked on "Browse With".Cynarra
E
0

• Go to Tools -> Options -> Debugging -> General : CHECK "Enable Just My Code".

• Go to Tools -> Options -> Debugging -> Symbols

• Click on the "..." button and create/select a new folder somewhere on your local computer to store cached symbols. Then Click on "Load all symbols" and wait for the symbols to be downloaded from Microsoft's servers, which may take a while. Note that Load all symbols button is only available while debugging.

• UNCHECK the checkmark next to "Microsoft Symbol Servers" to prevent Visual Studio from remotely querying the Microsoft servers. -> Click "OK".

Electrophilic answered 29/3, 2018 at 9:18 Comment(1)
I'm not sure this solves my question? It's not a matter of speed - it's telling Chrome/Edge to disable their local JS/CSS caching whenever VS opens the browser instead of me having to remember to do this every time.Weigle

© 2022 - 2024 — McMap. All rights reserved.