GetUrlCacheEntryInfo function

Retrieves information about a cache entry.


BOOL GetUrlCacheEntryInfo(
  _In_    LPCTSTR                     lpszUrlName,
  _Inout_ LPDWORD                     lpcbCacheEntryInfo


lpszUrlName [in]

A pointer to a null-terminated string that contains the name of the cache entry. The name string should not contain any escape characters.

lpCacheEntryInfo [out]

A pointer to an INTERNET_CACHE_ENTRY_INFO structure that receives information about the cache entry. A buffer should be allocated for this parameter.

Since the required size of the buffer is not known in advance, it is best to allocate a buffer adequate to handle the size of most INTERNET_CACHE_ENTRY_INFO entries. There is no cache entry size limit, so applications that need to enumerate the cache must be prepared to allocate variable-sized buffers.

lpcbCacheEntryInfo [in, out]

A pointer to a variable that specifies the size of the lpCacheEntryInfo buffer, in bytes. When the function returns, the variable contains the number of bytes copied to the buffer, or the required size of the buffer, in bytes.

Return value

Returns TRUE if successful, or FALSE otherwise. To get extended error information, call GetLastError. Possible error values include the following.

Return codeDescription

The specified cache entry is not found in the cache.


The size of lpCacheEntryInfo as specified by lpdwCacheEntryInfoBufferSize is not sufficient to contain all the information. The value returned in lpdwCacheEntryInfoBufferSize indicates the buffer size necessary to contain all the information.



GetUrlCacheEntryInfo does not do any URL parsing, so a URL containing an anchor (#) will not be found in the cache, even if the resource is cached. For example, if the URL is passed, the function returns ERROR_FILE_NOT_FOUND even if is in the cache.

Like all other aspects of the WinINet API, this function cannot be safely called from within DllMain or the constructors and destructors of global objects.

Note  WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft Windows HTTP Services (WinHTTP).


Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]







Unicode and ANSI names

GetUrlCacheEntryInfoW (Unicode) and GetUrlCacheEntryInfoA (ANSI)

See also

WinINet Functions