Quickly Clear the Browser Cache while Developing Client-Side Apps in Visual Studio 2010

Scot Hillier

by Scot Hillier on 3/21/2011

Share this:

Article Details

Date Revised:

Applies to:
Article, Content Type, EDITORIAL USE ONLY


Originally published on 3/21/2011 and reproduced here for reference

I develop a lot of Silverlight and JavaScript (jQuery plus client OM) features for SharePoint 2010. Whenever I'm working on these solutions, I constantly forget to clear the browser cache. Furthermore, clearing it manually is annoyingly painful. So here's a quick couple of tips for making it easier.

The first tip is to set up an External Tool entry that will let you clear the browser cache from within Visual Studio. Here's how you do it.

1. In Visual Studio, select Tools>>External Tools

2. In the External Tools dialog, click Add

3. In the Title field, type Clear Browser Cache

4. In the Command field, type RunDLL32.exe

5. In the Arguments field type InetCpl.cpl,ClearMyTracksByProcess 8

6. Click OK

There are several other options for the command that allow clearing of the cookies, form data, history, etc. There is a nice article here that explains the options.

The second tip is a different use of the same command. You can simply write a batch file that executes the command above and reference it from the Build Events tab in the Project Properties. That way, the browser cache will be cleared every time you run the solution from Visual Studio.


Topic: Article

Sign in with

Or register