Export (0) Print
Expand All
Expand Minimize

GetUrlCacheEntryInfoEx function

Retrieves information on the cache entry associated with the specified URL, taking into account any redirections that are applied in offline mode by the HttpSendRequest function.


BOOLAPI GetUrlCacheEntryInfoEx(
  _In_         LPCTSTR lpszUrl,
  _Inout_opt_  LPINTERNET_CACHE_ENTRY_INFO lpCacheEntryInfo,
  _Inout_opt_  LPDWORD lpcbCacheEntryInfo,
  _Reserved_   LPTSTR lpszRedirectUrl,
  _Reserved_   LPDWORD lpcbRedirectUrl,
  _Reserved_   LPVOID lpReserved,
  _In_         DWORD dwFlags


lpszUrl [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 [in, out, optional]

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, optional]

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.

lpszRedirectUrl [out]

This parameter is reserved and must be NULL.

lpcbRedirectUrl [in, out]

This parameter is reserved and must be NULL.


This parameter is reserved and must be NULL.

dwFlags [in]

This parameter is reserved and must be 0.

Return value

Returns TRUE if the URL was located, or FALSE otherwise. Call GetLastError for specific error information. Possible errors include the following.

Return codeDescription

The URL was not found in the cache index, even after taking any cached redirections into account.


The buffer referenced by lpCacheEntryInfo was not large enough to hold the requested information. The size of the buffer needed will be returned to lpdwCacheEntryInfoBufSize.



GetUrlCacheEntryInfoEx 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 http://example.com/example.htm#sample is passed, the function returns ERROR_FILE_NOT_FOUND even if http://example.com/example.htm 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

Minimum supported server

Windows 2000 Server







Unicode and ANSI names

GetUrlCacheEntryInfoExW (Unicode) and GetUrlCacheEntryInfoExA (ANSI)

See also

WinINet Functions



© 2014 Microsoft