Compartir a través de


CommitUrlCacheEntry

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function stores data in the specified file in the Internet cache and associates it with the given Uniform Resource Locator (URL).

Syntax

BOOL CommitUrlCacheEntry( 
  LPCTSTR lpszUrlName,
  LPCTSTR lpszLocalFileName, 
  FILETIME ExpireTime,
  FILETIME LastModifiedTime, 
  DWORD CacheEntryType,
  LPBYTE lpHeaderInfo, 
  DWORD dwHeaderSize,
  LPCTSTR lpszFileExtension, 
  DWORD dwReserved
);

Parameters

  • lpszUrlName
    [in] Address of a string variable that contains the source name of the cache entry. The name string must be unique and should not contain any escape characters.
  • lpszLocalFileName
    [in] Address of a string variable that contains the name of the local file that is being cached. This should be the same name as that returned by CreateUrlCacheEntry.
  • ExpireTime
    [in] FILETIME structure that contains the expire date and time (in Greenwich mean time) of the file that is being cached. If the expire date and time is unknown, set this parameter to zero.
  • LastModifiedTime
    [in] FILETIME structure that contains the last modified date and time (in Greenwich mean time) of the URL that is being cached. If the last modified date and time is unknown, set this parameter to zero.
  • CacheEntryType
    [in] Unsigned long integer value that contains the cache type bitmask. Currently, the cache entry type values have not been finalized, so this value does not serve a real purpose, except for STICKY_CACHE_ENTRY. The following list shows the possible values. These values can be used in any combination:

    • COOKIE_CACHE_ENTRY
    • EDITED_CACHE_ENTRY
    • NORMAL_CACHE_ENTRY
    • SPARSE_CACHE_ENTRY
    • STICKY_CACHE_ENTRY
    • TRACK_OFFLINE_CACHE_ENTRY
    • TRACK_ONLINE_CACHE_ENTRY
    • URLHISTORY_CACHE_ENTRY
  • lpHeaderInfo
    [in] Address of the buffer containing the header information. If this parameter is not NULL, the header information is treated as extended attributes of the URL and is returned in the INTERNET_CACHE_ENTRY_INFO structure.
  • dwHeaderSize
    [in] Unsigned long integer value that contains the size of the header information. If lpHeaderInfo is not NULL, this value is assumed to indicate the size of the buffer that will store the header information. An application can maintain headers as part of the data and provide dwHeaderSize together with a NULL value for lpHeaderInfo.
  • lpszFileExtension
    [in] Address of a buffer that contains information maintained in the cache database for future use.
  • dwReserved
    [in] Reserved. Must be set to zero.

Return Value

Returns TRUE if successful, or FALSE otherwise.

Remarks

If the cache storage is full, this function invokes cache cleanup to make space for the new file. If the cache entry already exists, the function overwrites the entry if it is not in use. An entry is in use when it has been retrieved with RetrieveUrlCacheEntryFile.

Clients that add entries to the cache should set the headers to at least "HTTP/1.0 200 OK\r\n\r\n"; otherwise, client applications that use the Microsoft WinInet functions may disregard the entry.

Requirements

Header wininet.h
Library wininet.lib
Windows Embedded CE Windows CE 2.12 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

CreateUrlCacheEntry
DeleteUrlCacheEntry
RetrieveUrlCacheEntryFile
INTERNET_CACHE_ENTRY_INFO
WinInet Functions

Other Resources

FILETIME