A couple of days ago I was looking for a tool to exclude a site from being served from Forefront TMG’s cache, and came across CacheDir in the Forefront TMG SDK.

Many Forefront TMG admins are used to deleting the cache file when experiencing a cache problem. But there is no need to do this when running CacheDir!

Once you have installed CacheDir, you can find its executable in C:\Program Files (x86)\Microsoft Forefront TMG Tools\CacheDir, but if you run CacheDir from this location, you will get the following message:

errocachedir

This error occurred because the EXE file needs to be located in the Forefront TMG installation folder. Unfortunately there is no way to change its folder location during the installation.

To solve this problem, just copy or move CacheDir EXE file from its original location to Forefront TMG installation folder (%path%\Program Files\Microsoft Forefront Threat Management Gateway). Now when double clicking the file, you will see the screen as below:

image

All the sites with content being served from TMG’s Cache are presented on the left hand side. Simply right click a site and select ‘Mark as Obsolete’ to remove this site from the cache, as in the image below:
image

CacheDir certainly makes life easier when you need to analyze and edit Forefront TMG’s Cache file

If you are still using ISA Server, click here to download the appropriate version.