Exploring the URL Cache | CodeGuru

Exploring the URL Cache

Click here for a larger image. Environment: VC6, WTL 7.0, WinXP My desire to create one button to blow away all files left on my machine from my browser led me down the path of the URL Cache. This seems to be the place where all Internet-related files are managed. Of course, this journey turned […]

Written By
CodeGuru Staff
CodeGuru Staff
May 30, 2003
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



Click here for a larger image.

Environment: VC6, WTL 7.0, WinXP

My desire to create one button to blow away all files left on my machine from my browser led me down the path of the URL Cache. This seems to be the place where all Internet-related files are managed. Of course, this journey turned into a full-blown application caused me to look into the cache and view the details of what’s actually kept there.

All methods to manipulate the URL cache are a part of the WinInet library. This library is fairly low-level (not quite at the socket level, but it’s pretty far down there). In addition to the cache, the library also provides HTTP, FTP, and Gopher file transfer functionality.

Walking the URL cache is very similar to using the Win32 file-realted functions. FindFirst (with some parameters) returns a handle, FindNext (until there are no more), that sort of thing. I developed a set of classes to deal with the nitty-gritty. You’ll find these in the UrlCacheUtil.h/.cpp file.

The application is fairly self documenting (famous last words). I’ll leave it to you get out of it what you want. The detail dialog is modless, so it can be left up as you scroll through the cache entries.

Some interesting notes:


  • There are definitely some undocumeneted CacheEntryTypes being used. I suspect IE creates some for its own internal use.

  • The groups are somewhat a mystery to me. I haven’t come across one with a name yet. I suspect all entries go into an unnamed group by default.

Downloads


Download demo project – 39 Kb


Download source – 26 Kb

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.